The UI Package
TailwindCSS, Alpine.js and Laravel Livewire UI kit for Artisans.
📋 Requirements
- Requires PHP 8.1+ (at least 8.1.21 recommended to avoid potential bugs).
- Requires Node JS 18.16+ (at least 18.16.1 recommended to avoid potential bugs).
- Requires Composer >=2.5.8 to manage PHP dependencies.
- Requires pnpm@^8.0.0 to manage TypeScript dependencies.
- Requires Git ~2.40.0 to manage source code versions.
🎉 Getting Started
⚡️ Installation
Install the Sikessem UI kit using Composer:
- By adding the
sikessem/ui
dependency to yourcomposer.json
file:
- Or by including the dependency:
🧑💻 Usage
📝 Syntax
There are several ways to use Sikessem’s UI components.
In the following examples component-name represents the name of the desired UI component. If you want to use the text component, replace component-name with text as needed.
You can find the list of all components here.
View namespace
Component alias
Component tags
Component slots
Blade directives
Render a UI component:
If component-name is not a UI component it will be rendered as an HTML element.
Render an HTML orphan tag:
Render an HTML paired tag:
Note that the name of the element is not specified when closing. This is automatically detected according to the nesting order of the paired elements.
ui() helper
UI facade
🍱 UI Components
In the following examples, we will use component tags. However, the result will be the same if you prefer to use another syntax.
Text component
Allows to translate and/or escape a text:
This will output the following HTML:
Link component
Create an anchor pointing to a route or URL:
This will output the following HTML:
Button component
The Blade input:
The HTML output:
The Blade input:
The HTML output:
The Blade input:
The HTML output:
The Blade input:
The HTML output:
The Blade input:
The HTML output:
The Blade input:
The HTML output:
Menu component
Create a menu containing a list of entries:
This will output the following HTML:
Label component
Create a label:
This will output the following HTML:
Flash component
Create a flash:
If session “info” was set to “Info”, the output will be:
Otherwise, the output will be:
Or (in the second example):
Flashes component
If the “info” and “warning” sessions have been set to “Info” and “Warning” respectively, the output will be:
Otherwise, the output will be:
Form component
Create a form:
This will output the following HTML:
Error component
Create a error:
Errors component
Entry component
Create an entry:
This will output the following HTML:
Icon component
🎨 Custom components
Create custom components from config/ui.php
file.
Output: