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-avatar src="/photo.jpg" alt="User" />
Avatar -> extends BeartropyComponentavatar.blade.php (single template, no base delegation)resources/views/presets/avatar.php (flat color -> classes, no variants)resources/views/presets/sizes.php (uses avatar key)| Prop | PHP Type | Default | Blade Attribute |
|---|---|---|---|
| src | ?string |
null |
src="/photo.jpg" |
| alt | string |
'' |
alt="Name" |
| size | ?string |
null |
size="lg" |
| color | ?string |
null |
color="red" |
| initials | ?string |
null |
initials="JD" |
| customSize | ?string |
null |
customSize="w-20 h-20" |
beartropy)beartropy, red, orange, amber, yellow, lime, green, emerald, teal, cyan, sky, blue, indigo, violet, purple, fuchsia, pink, rose, gray, slate, stone, zinc, neutral
md)xs, sm, md, lg, xl
| Slot | Description |
|---|---|
| default | Custom content inside avatar (replaces default SVG) |
| status | Status indicator positioned at bottom-right corner |
$src set -> <img> with object-cover + all preset classes$initials set -> <span> with initials text<span> with slot content<span> with default silhouette SVGcolors -> {color} -> {bg, text, border, ring, font}
22 flat colors (no variants). Each provides: bg-{color}-600, text-white, border classes, optional ring, font-bold.
avatar key)| Size | Classes |
|---|---|
| xs | w-6 h-6 text-xs |
| sm | w-8 h-8 text-sm |
| md | w-10 h-10 text-base |
| lg | w-12 h-12 text-lg |
| xl | w-16 h-16 text-xl |
div.flex.items-center.h-full
div.inline-block.relative
<img> | <span>initials</span> | <span>slot/svg</span>
[status slot: span.absolute.bottom-0.right-0]
{{-- Image avatar --}}
<x-bt-avatar src="/user.jpg" alt="Jane" />
{{-- Initials with color --}}
<x-bt-avatar red initials="JD" />
{{-- Sized --}}
<x-bt-avatar lg initials="AB" />
{{-- With status indicator --}}
<x-bt-avatar lg src="/user.jpg">
<x-slot:status>
<span class="block w-3 h-3 rounded-full bg-green-500 ring-2 ring-white"></span>
</x-slot:status>
</x-bt-avatar>
{{-- Custom slot content --}}
<x-bt-avatar lg color="blue">
<x-bt-icon name="user" class="w-6 h-6" />
</x-bt-avatar>
{{-- Custom size --}}
<x-bt-avatar customSize="w-20 h-20 text-2xl" initials="XX" />
{{-- Dynamic color --}}
<x-bt-avatar :color="$user->avatar_color" :initials="$user->initials" />
$classes string built from presets$attributes->merge() is used on all branches so custom classes/attributes propagatecustomSize overrides the size preset's avatar key but preserves color classeslabel prop — use initials for text contentcomponent_defaults — color falls back to first preset key (beartropy), size falls back to mdHow can I help you explore Laravel packages today?