Avatar
Live Demos HubAvatar
Interactive production-grade hypermedia component for HTMXUI.
Interactive Preview
HTML Source
<!--
Component: avatar.html
Configurable State: themeColor ('primary'|'secondary'|'destructive'), size ('sm'|'md'|'lg'), isOpen (boolean)
Usage: Bind styles dynamically using hx-class="{ 'bg-primary': themeColor === 'primary' }" or hx-style="{ width: size === 'lg' ? '100%' : 'auto' }"
-->
<!-- Avatar Component -->
<span hx-ext="reactive" hx-state="{ themeColor: \'primary\', size: \'md\', isOpen: false }" class="relative flex h-10 w-10 shrink-0 overflow-hidden rounded-full bg-muted">
<img class="aspect-square h-full w-full object-cover" src="{src}" alt="{alt}" loading="lazy" />
</span>