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-input />
Input → extends InputBase → extends BeartropyComponentinput.blade.php → delegates to base/input-base.blade.phpresources/views/presets/input.php (flat color → classes)resources/views/presets/sizes.phpresources/css/beartropy-ui.css (slot chrome stripping, autofill fixes, focus resets)| Prop | PHP Type | Default | Blade Attribute |
|---|---|---|---|
| iconStart | ?string |
null |
icon-start="envelope" |
| iconStartSvg | ?string |
null |
icon-start-svg="<svg>..." |
| iconEnd | ?string |
null |
icon-end="magnifying-glass" |
| iconEndSvg | ?string |
null |
icon-end-svg="<svg>..." |
| copyButton | bool |
false |
:copy-button="true" |
| clearable | bool |
true |
:clearable="false" |
| help | ?string |
null |
help="Help text" |
| showPasswordToggle | bool |
false |
:show-password-toggle="true" |
| customError | mixed |
null |
:custom-error="$error" |
| value | mixed |
null |
value="text" |
| hint | ?string |
null |
hint="Hint text" |
| type | untyped | 'text' |
type="password" |
| size | untyped | null |
size="lg" or magic: lg |
| color | untyped | null |
color="blue" or magic: blue |
| label | untyped | null |
label="Email" |
| placeholder | untyped | null |
placeholder="Type..." |
| spinner | bool |
true |
:spinner="false" |
Note: type, size, color, label, placeholder are intentionally untyped because InputBase keeps them untyped for child class compatibility.
primary via config)primary, beartropy, red, blue, green, yellow, purple, pink, gray, orange, amber, lime, emerald, teal, cyan, sky, indigo, violet, rose, fuchsia, slate, stone, zinc, neutral
md)xs, sm, md, lg, xl
fill — applies $colorPreset['bg'] tinted background. Without fill, the input gets bg-white dark:bg-gray-900.
| Slot | Description |
|---|---|
| start | Content before the input field (flush, chrome stripped by CSS) |
| end | Content after built-in controls (flush, chrome stripped by CSS) |
CSS class .beartropy-inputbase-start-slot > * and .beartropy-inputbase-end-slot > * strip:
border-width: 0border-radius: 0box-shadow: noneheight: 100%This means <x-bt-button> and <x-bt-select> placed in slots automatically integrate without extra styling.
The template auto-detects the binding mode:
wire:model present → passes through to <input>x-model present → binds to that Alpine propertyx-data with value, showPassword, copySuccess, clear(), copyToClipboard()$errors bag using wire:model name:custom-error="$message" propcolors → {color} → {bg, border, border_error, ring, ring_error, text, placeholder, label, label_error, chip_bg, chip_text, chip_close}
No variants — flat color map. Fill mode uses bg key, outline mode uses bg-white dark:bg-gray-900.
wire:* attributes (except wire:model)wire:target{{-- Basic --}}
<x-bt-input label="Name" placeholder="Enter name..." />
{{-- Livewire --}}
<x-bt-input wire:model.live="search" label="Search" icon-start="magnifying-glass" />
{{-- Password --}}
<x-bt-input type="password" label="Password" :clearable="false" />
{{-- With copy --}}
<x-bt-input label="API Key" :copy-button="true" :clearable="false" value="sk-123" />
{{-- Color + Fill --}}
<x-bt-input fill blue label="Blue Input" />
{{-- Size --}}
<x-bt-input sm label="Small" />
{{-- Button in end slot --}}
<x-bt-input label="Message" placeholder="Type...">
<x-slot:end>
<x-bt-button color="beartropy">Send</x-bt-button>
</x-slot:end>
</x-bt-input>
{{-- Select in start slot --}}
<x-bt-input label="Phone" placeholder="123-456-7890">
<x-slot:start>
<x-bt-select :options="['+1 US', '+44 UK']" placeholder="Code" />
</x-slot:start>
</x-bt-input>
{{-- Validation error --}}
<x-bt-input wire:model="email" label="Email" />
{{-- Error auto-detected from $errors->first('email') --}}
{{-- Custom error --}}
<x-bt-input label="Code" :custom-error="'Invalid code'" />
{{-- Disabled --}}
<x-bt-input label="Locked" disabled value="Cannot change" />
'input' => [
'color' => env('BEARTROPY_UI_INPUT_COLOR', 'primary'),
'size' => env('BEARTROPY_UI_INPUT_SIZE', 'md'),
'outline' => env('BEARTROPY_UI_INPUT_OUTLINE', true),
],
clearable defaults to true — explicitly disable with :clearable="false" when using copy-button or type="password"primary color = neutral gray border + beartropy focus ring (best for general forms)$end slot renders flush outside that containerhelp and hint are aliases — both show text below the field; help takes precedenceHow can I help you explore Laravel packages today?