View laravel-hotwire on GitHub
1M
v0.91.0
Search 71 components and 72 controllers by name, category or description.
Avatar
User avatar with image, initials fallback, status badge and overlapping groups
Image with initials fallback
Pass src and name for the shortcut form. name derives the initials, initials overrides them, and fallback replaces them with arbitrary content.
<hw:avatar src="https://i.pravatar.cc/80?img=32" name="Dina Maia" />
<hw:avatar name="Ada Lovelace" />
<hw:avatar name="Dina Maia" initials="EM" />
<hw:avatar fallback="?" />
Sizes & shapes
size takes sm, the default, or lg; shape takes the default circle or square.
AL
AL
AL
AL
AL
<hw:avatar name="Ada Lovelace" size="sm" />
<hw:avatar name="Ada Lovelace" />
<hw:avatar name="Ada Lovelace" size="lg" />
<hw:avatar name="Ada Lovelace" shape="square" />
<hw:avatar name="Ada Lovelace" shape="square" size="lg" />
Composition
Full control via avatar.image + avatar.fallback, for when the shortcut props are not enough.
<hw:avatar size="lg" shape="square">
<hw:avatar.image src="https://i.pravatar.cc/120?img=15" alt="Ada Lovelace" />
<hw:avatar.fallback>AL</hw:avatar.fallback>
</hw:avatar>
Badges
avatar.badge defaults to a presence dot at bottom-end. position moves it and the slot replaces the dot with an icon or a count.
{{-- Default badge: presence dot, bottom-end --}}
<hw:avatar src="https://i.pravatar.cc/80?img=22" name="Dina Maia">
<hw:avatar.badge />
</hw:avatar>
<hw:avatar src="https://i.pravatar.cc/80?img=24" name="Dina Maia">
<hw:avatar.badge position="top-end">
<hw:icon name="check" />
</hw:avatar.badge>
</hw:avatar>
<hw:avatar name="Dina Maia" size="lg">
<hw:avatar.badge position="top-start" class="bg-red-500 text-white">
3
</hw:avatar.badge>
</hw:avatar>
Groups
avatar.group overlaps its children and avatar.group-count closes the stack with an overflow marker.
<hw:avatar.group>
<hw:avatar src="https://i.pravatar.cc/80?img=1" name="Ana Silva" />
<hw:avatar src="https://i.pravatar.cc/80?img=2" name="Dina Maia" />
<hw:avatar src="https://i.pravatar.cc/80?img=3" name="Joao Lima" />
<hw:avatar name="Kris Predovic" />
<hw:avatar.group-count>+3</hw:avatar.group-count>
</hw:avatar.group>