M Majid DS mds
GitHub

Flux components

Avatar

Show a user or entity with an image, initials, or an icon.

<flux:avatar src="https://picsum.photos/seed/user/64/64" />

Initials

Pass initials directly, or pass a name and Flux derives the initials from it. Persian names work as-is — the letters render in the page's font-sans, the same face as the rest of the page.

MM
SR
مم
<flux:avatar initials="MM" />
<flux:avatar name="Sara Rezaei" />
<flux:avatar initials="مم" />

Colors

A fixed color, or color="auto" to derive one from the name so the same person always gets the same color.

SR
MM
AB
CD
<flux:avatar name="Sara Rezaei" color="auto" />
<flux:avatar initials="MM" color="blue" />
<flux:avatar initials="AB" color="rose" />
<flux:avatar initials="CD" color="green" />

Sizes

XS
SM
MD
LG
XL
<flux:avatar size="xs" initials="XS" />
<flux:avatar size="sm" initials="SM" />
<flux:avatar initials="MD" />
<flux:avatar size="lg" initials="LG" />
<flux:avatar size="xl" initials="XL" />

Circle

MM
<flux:avatar circle src="https://picsum.photos/seed/user/64/64" />
<flux:avatar circle initials="MM" color="indigo" />
<flux:avatar circle icon="user" />

Badge

A presence dot, a count, or any content in the corner.

MM
AB
<flux:avatar circle badge badge:color="green" badge:circle initials="MM" />
<flux:avatar circle badge="7" badge:color="red" initials="AB" />

Group

Overlap a set of avatars with flux:avatar.group.

3+
<flux:avatar.group>
    <flux:avatar circle src="https://picsum.photos/seed/a1/48/48" />
    <flux:avatar circle src="https://picsum.photos/seed/a2/48/48" />
    <flux:avatar circle src="https://picsum.photos/seed/a3/48/48" />
    <flux:avatar circle initials="3+" />
</flux:avatar.group>

Reference

flux:avatar

PropDescription
srcImage URL.
initialsLetters shown when there is no image.
nameFull name; initials are derived from it when initials is absent.
iconIcon shown instead of initials (e.g. user).
icon:variantIcon variant. Default: solid.
sizeOptions: xs, sm, md, lg, xl. Default: md.
colorA Tailwind color, or auto to derive one from the name.
circleIf true, fully rounded instead of a squircle.
badgeCorner badge. true for a plain dot, or any content.
tooltipTooltip content shown on hover.
hrefRenders the avatar as a link.
asUnderlying element. Default: div.
altAlt text for the image.

flux:avatar.group

Overlaps its child avatars. Takes no props.

Related