esoboy / ui
Composable Blade components for Laravel 13 and Livewire 4.
Requires
- php: ^8.4
- bacon/bacon-qr-code: ^3.1
- illuminate/support: ^13.0
- illuminate/view: ^13.0
- league/commonmark: ^2.10.7
- livewire/blaze: ^1.0
- livewire/livewire: ^4.4
- symfony/html-sanitizer: ^8.0
Requires (Dev)
None
Suggests
None
Provides
None
Conflicts
None
Replaces
None
README
Composable, zero-class Blade UI components for Laravel 13, Livewire 4, Alpine.js, and Tailwind CSS v4.
Features
- Blade-first &
@blazeready — Structural DOM rendered in Blade with zero internal Livewire components and zero global config files. - Zero-class CSS architecture — All component styles live in
@layer componentswith zero class selectors, zero hardcoded colors outsidetheme.css, and[data-slot]/data-*state attributes, so host Tailwind utilities override cleanly withouttailwind-merge. - Tailwind CSS v4
@theme defaulttokens — Customize surfaces, overlays, status colors, radii, shadows, and control heights directly in your host@theme, with pure@variant darkdark mode (no.darkclass assumption). - Zero-dependency Alpine plugin (
dist/ui.js) — Native<dialog>, Popover API, Livewire 4x-anchor/x-collapse, and lightweight step validation for<x-ui::questionnaire>. - Livewire 4 first-class form controls — Direct
wire:model*/x-modelablebinding across all controls (includingToggle,ToggleGroup,FileUpload, andEditor) with<x-ui::field>@awarecontext inheritance and automatic Laravel$errorsinvalid state. - First-class Laravel integrations — Direct
paginate()/simplePaginate()/cursorPaginate()support inPaginationandDataTable, LivewireWithFileUploadsFileUpload, Blade-renderedMediaPreview, PHP-sideToast(Livewire & Session flash),bacon/bacon-qr-codeSVGQrCode, and on-demand standalone TiptapEditor(@assetsdata-navigate-once). - Laravel Boost skills included — Ships with
resources/boost/skills/esoboy-ui-development/for AI-assisted development.
Requirements
- PHP
^8.4 - Laravel
^13.0 - Livewire
^4.4 - Tailwind CSS
^4.0
Installation
composer require esoboy/ui
1. Import Styles (resources/css/app.css)
@import 'tailwindcss'; @import '../../vendor/esoboy/ui/dist/ui.css'; @custom-variant dark (&:where(.dark, .dark *));
Customize theme tokens directly in your host @theme:
@theme { --color-primary: oklch(0.55 0.22 262); --radius-control: 0.5rem; }
2. Register Alpine Plugin (resources/js/app.js)
import '../../vendor/esoboy/ui/dist/ui.js'
dist/ui.js automatically registers all Alpine.data modules idempotently on alpine:init (or on an existing window.Alpine).
3. Optional: Publish Standalone Editor Assets
<x-ui::editor> loads its standalone editor.css and editor.js bundles on demand via a package asset route with content-hashed immutable caching. To serve them directly from public/vendor/esoboy/ui/:
php artisan vendor:publish --tag=ui-assets
Quick Start
Forms & Validation
<x-ui::field name="role" required> <x-ui::field.label>Role</x-ui::field.label> <x-ui::select wire:model="role" clearable> <x-ui::select.option value="admin">Administrator</x-ui::select.option> <x-ui::select.option value="editor">Editor</x-ui::select.option> </x-ui::select> <x-ui::field.description>Controls dashboard permissions.</x-ui::field.description> <x-ui::field.error /> </x-ui::field>
PHP-Side Toast Notifications
Place <x-ui::toaster /> once in your layout:
<x-ui::toaster position="bottom-right" />
Trigger, update, or dismiss toasts from Livewire 4 components or HTTP controllers:
use Esoboy\Ui\Support\Toast; // Inside a Livewire 4 component $id = Toast::to($this)->loading('Exporting report...', id: 'export'); Toast::to($this)->success('Report ready', id: $id); Toast::to($this)->dismiss($id); // Inside a controller before redirect Toast::success('Settings saved'); return redirect()->route('settings');
DataTable & Laravel Pagination
<x-ui::data-table :columns="$columns" :rows="$users" selectable searchable column-toggle livewire> <x-slot:bulkActions> <x-ui::button size="xs" variant="outline" status="danger" x-on:click="$wire.deleteSelected(selected)"> Delete Selected </x-ui::button> </x-slot:bulkActions> @foreach ($users as $user) <x-ui::data-table.row :key="$user->id" :search-text="$user->name"> <x-ui::data-table.cell column="name">{{ $user->name }}</x-ui::data-table.cell> <x-ui::data-table.cell column="status"> <x-ui::badge :status="$user->active ? 'success' : 'neutral'"> {{ $user->active ? 'Active' : 'Inactive' }} </x-ui::badge> </x-ui::data-table.cell> </x-ui::data-table.row> @endforeach </x-ui::data-table> <x-ui::pagination :paginator="$posts" livewire />
File Upload
<x-ui::field name="attachments" required> <x-ui::field.label>Attachments</x-ui::field.label> <x-ui::file-upload wire:model="attachments" multiple accept="image/*,.pdf" max-size="5MB" :max-files="5" /> <x-ui::field.error /> </x-ui::field>
Design Contract
- Orthogonal
variant,status, andstate:variantis semantically named per component function with consistent naming across peer components (surface controls sharedefault/secondary/outline/ghost/link, tabs usedefault/line, sidebar usessidebar/floating/inset, etc.) and never encodes status colors;status(neutral,info,success,warning,danger) controls semantic color; workflow progression (Steps.Item,Trace) usesstate(data-state). - Unified
sizescale: Always uses ordered tokens (xs,sm,md,lg, etc. — defaultmd, neverdefault/base/normal). File sizes on<x-ui::attachment>usefile-size. - Div-based triggers & close wrappers: All component triggers and overlay close/action wrappers render a
<div>layout container so the host application controls the inner interactive elements freely without nested<button>conflicts. - Zero content processing:
<x-ui::rich-text>provides read-only typography styling only; host applications handle Markdown conversion and HTML sanitization.
License
Released under the MIT License.