# Leaf UI
Leaf UI is a simple UI library for PHP. Leaf UI lets you quickly scaffold webpages without leaving the comfort of PHP; No more writing weird strings, no more weird formatting for HTML inside PHP. One thing to note is that all Leaf UI elements render plain HTML in the browser.
# Simple Example
use Leaf\UI;
$ui = form("method", "action", [
h2("Subscribe to my newsletter"),
input("type", "name", ["placeholder" => "Enter your email", "label" => "Email"]),
button("Get Started", ["type" => "submit"])
]);
UI::render($ui);
1
2
3
4
5
6
7
8
9
2
3
4
5
6
7
8
9
OUTPUT:
As you've noticed, Leaf UI uses a "function based" syntax, as opposed to traditional HTML tags. This syntax is heavily inspired by flutter (opens new window) and reactjs(without JSX).
# Installation
You can install Leaf UI with composer. Simply run:
composer require leafs/ui
1
# Next Steps
We need your help developing Leaf UI. You can contribute to Leaf UI on github (opens new window)
Built with ❤ by Mychi Darko