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-radio />
Radio → extends BeartropyComponentradio.blade.phpresources/views/presets/radio.php (24 color variants + primary)resources/views/presets/sizes.phpsupport/field-help.blade.php for error and help text below field (suppressed when $grouped is true)peer-checked: for state| Prop | PHP Type | Default | Blade Attribute |
|---|---|---|---|
| labelPosition | ?string |
null |
label-position="left" |
| size | ?string |
null |
size="lg" or magic: lg |
| color | ?string |
null |
color="blue" or magic: blue |
| label | ?string |
null |
label="Option" |
| customError | mixed |
null |
:custom-error="$error" |
| disabled | bool |
false |
:disabled="true" |
| grouped | bool |
false |
:grouped="true" |
| help | ?string |
null |
help="Help text" |
| hint | ?string |
null |
hint="Hint text" |
HTML attributes (name, value, checked, required, id, wire:model, etc.) are NOT constructor props — they pass through $attributes to the native <input>.
beartropy 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
| Slot | Description |
|---|---|
| default | Label content override (takes precedence over label prop). Supports rich HTML. |
colors → {color} → {
checked, bg, border, border_error,
hover, focus, focus_error,
active, disabled, dot,
label, label_error
}
checked — peer-checked:border-{color}-600 peer-checked:bg-{color}-600dot — inner dot color: bg-white dark:bg-black (or color-tinted for some variants)disabled — opacity-60 cursor-not-allowed<div> wraps <label> + field-help<label> contains the radio circle and label text<input type="radio"> is sr-only (visually hidden but accessible)rounded-full <span> with border/bg presetsrounded-full <span> centered via translate, animated with scale-0 peer-checked:scale-100$errors bag for field name or wire:model valuecustomError propborder_error, focus to focus_error, label to label_errorfield-help component below the radiogrouped is true, field-help is suppressed (the RadioGroup handles it){{-- Basic --}}
<x-bt-radio name="plan" value="free" label="Free Plan" />
{{-- Multiple options --}}
<x-bt-radio name="plan" value="free" label="Free" wire:model="plan" />
<x-bt-radio name="plan" value="pro" label="Pro" wire:model="plan" />
{{-- Pre-checked --}}
<x-bt-radio name="plan" value="free" label="Free" checked />
{{-- Colored --}}
<x-bt-radio blue name="opt" value="1" label="Blue option" />
{{-- Sized --}}
<x-bt-radio lg name="opt" value="1" label="Large option" />
{{-- Label on left --}}
<x-bt-radio name="opt" value="1" label="Left label" label-position="left" />
{{-- Rich label via slot --}}
<x-bt-radio name="tos" value="yes">
I accept the <a href="/terms">Terms</a>
</x-bt-radio>
{{-- Disabled --}}
<x-bt-radio name="opt" value="1" label="Locked" :disabled="true" />
{{-- With help text --}}
<x-bt-radio name="opt" value="1" label="Option" help="Extra context." />
{{-- Custom error --}}
<x-bt-radio name="opt" value="1" :custom-error="'Required'" />
{{-- Livewire --}}
<x-bt-radio name="plan" value="free" label="Free" wire:model.live="plan" />
'radio' => [
'color' => env('BEARTROPY_UI_RADIO_COLOR', 'beartropy'),
'size' => env('BEARTROPY_UI_RADIO_SIZE', 'md'),
],
peer/peer-checked: selectors<input> is sr-only — the visible radio is a styled <span> with rounded-fullname, value, checked, required, id are NOT constructor props — they pass through $attributes->merge() to the native <input>help and hint are aliases; help takes precedencelabel prop (checked via trim($slot) !== '')grouped is true, field-help is hidden — the parent RadioGroup shows errors/help insteadprimary preset maps to beartropy colorsHow can I help you explore Laravel packages today?