beartropy/ui
Beartropy UI is a small Laravel UI package providing ready-made components and helpers to speed up building admin and front-end screens. Drop in common layouts, forms, and UI utilities to get a consistent look fast with minimal setup.
<x-bt-dialog />
<x-bt-dialog size="lg" />
Dialog → extends BeartropyComponentdialog.blade.php (self-contained, no partials)resources/js/modules/bt-dialog.js (btDialog() function)resources/js/modules/dialog.js (dialog() function, exported from beartropy-ui.js)src/Traits/HasDialogs.php (dispatches bt-dialog event)| Prop | PHP Type | Default | Description |
|---|---|---|---|
| size | ?string |
'md' |
Default panel width — overridable per dialog via event payload |
$this->dialog()->success(...) (or confirm, delete, etc.)HasDialogs trait calls $this->dispatch('bt-dialog', $payload)x-on:bt-dialog.window="openDialog($event.detail)"btDialog.openDialog() parses payload, sets state, opens dialogclickAccept() / clickReject() → find Livewire component via componentId → call methoddialog.success('Title') (from modules/dialog.js)CustomEvent('bt-dialog', { detail: payload }) on windowNamed sizes map to one step wider for readability:
max-w-md, md → max-w-lg, lg → max-w-xl, xl → max-w-2xl, 2xl → max-w-3xlbtDialog)isOpen, type, title, description, iconaccept / reject — { label, method, params } or nullcomponentId — Livewire component ID for method callsacceptBusy / rejectBusy — loading statesallowOutsideClick, allowEscape — close behaviorpanelSizeClass — resolved Tailwind max-width classglobalSize — default size from Blade proptypeStyles — PHP-generated icon color mapbuttonColors — JS-defined single-button color mapinfo, success, warning, error, confirm, danger — each with iconBg and iconText classes.
| Method | Signature | Type |
|---|---|---|
dialog() |
(): static |
Fluent accessor |
success() |
(string $title, ?string $description, array $options) |
Alert |
info() |
(string $title, ?string $description, array $options) |
Alert |
warning() |
(string $title, ?string $description, array $options) |
Alert |
error() |
(string $title, ?string $description, array $options) |
Alert |
confirm() |
(array $config) |
Two-button confirm |
delete() |
(string $title, ?string $description, array $options) |
Danger confirm |
dialog)dialog.success(title, description?, options?)
dialog.info(title, description?, options?)
dialog.warning(title, description?, options?)
dialog.error(title, description?, options?)
dialog.confirm({ title, description?, accept, reject, ... })
dialog.delete(title, description?, { method, params, componentId, ... })
beartropy-ui::ui.ok — accept button fallback, single-button textbeartropy-ui::ui.cancel — reject button fallbackbeartropy-ui::ui.confirm — confirm accept button fallbackbeartropy-ui::ui.delete — delete accept button fallbackbeartropy-ui::ui.are_you_sure — confirm title fallbackbtDialog( — Alpine initrole="dialog", aria-modal="true" — accessibilityx-cloak, x-show="isOpen" — visibilityglobalSize: "..." — size prop passthroughx-trap.noscroll.inert="isOpen" — focus trapx-on:bt-dialog.window — event listenerz-[9999] — stackingmd:pt-[18vh] — desktop offsetclickAccept(), clickReject() — button handlersisSingleButton, buttonColors — single-button modeHow can I help you explore Laravel packages today?