robsontenorio/mary
Gorgeous Livewire UI components for Laravel, powered by Tailwind CSS and daisyUI. maryUI provides ready-to-use, polished components to build modern apps faster, with full documentation, community support, and MIT license.
Installation:
composer require robsontenorio/mary
For Tailwind-only (no CSS):
composer require robsontenorio/mary --with-all-dependencies --no-css
Publish Config (optional):
php artisan vendor:publish --provider="RobsonTenorio\Mary\MaryServiceProvider" --tag="config"
Configure in config/mary.php (e.g., default theme, locale, CDN paths).
Add to Livewire View:
@livewireStyles
@livewireScripts
@maryStyles
@maryScripts
<mary-input wire:model="name" label="Name" />
text, email, password, etc.).mary-card with mary-input or mary-table:
<mary-card>
<mary-input wire:model="email" label="Email" />
<mary-button type="submit">Save</mary-button>
</mary-card>
{{ $slot }} for custom content (e.g., mary-modal with custom footer).wire:model for reactive data:
<mary-select wire:model="status" :options="$statuses" label="Status" />
@mary-open.window="handleDrawerOpen").<mary-button class="bg-blue-600 hover:bg-blue-700">Custom</mary-button>
config/mary.php for global defaults (e.g., theme: 'dark').popover or tooltip attributes:
<mary-input label="Password" popover="Show hint" />
x-if or x-show:
<mary-toast x-show="showSuccess" type="success" />
<mary-input wire:model="phone" label="Phone" rules="required|numeric" />
mary-tabs or mary-steps for progressive disclosure.CDN Dependencies:
mary-calendar) require external JS/CSS (check docs).config/mary.php are correct or use local assets.Livewire 4+ Compatibility:
@this for component references in Livewire 4:
<mary-modal @this="$modal" />
Tailwind Conflicts:
!important sparingly or override in tailwind.config.js:
safelist: ['bg-primary', 'text-secondary']
State Management:
wire:model for complex state. Use Livewire properties for derived data:
public $name;
public $fullName => "{$this->name} Doe";
Component Isolation:
mary-drawer) require unique IDs. Use wire:key if dynamically rendered:
<mary-drawer wire:key="'drawer-'.$id" />
<mary-modal @open="console.log('Opened')" />
Custom Components:
vendor/robsontenorio/mary/resources/views to resources/views/vendor/mary.public function mount() {
$this->dispatch('mary-init');
}
Plugin System:
mary:register in AppServiceProvider to add custom components:
Mary::register('custom-component', CustomComponent::class);
Localization:
resources/lang/vendor/mary.'validation' => [
'required' => 'Custom required message',
],
mary-table), use x-data to lazy-initialize:
<mary-table x-data="{ loaded: false }" @loaded="loaded = true" />
public function hydrate() {
$this->dispatch('mary-cleanup');
}
dark: variants for Tailwind classes:
<mary-button dark:bg-gray-800>Dark Button</mary-button>
aria-* attributes for screen readers:
<mary-tooltip aria-label="Description">Hover me</mary-tooltip>
livewire/test to test components:
$this->assertSee('mary-input');
How can I help you explore Laravel packages today?