Avatars: an image or initials in a circle, a square, a squircle or any mask shape, with a status dot, a gradient ring, and stacked in groups.
<.avatar name="Ana Souza" color="auto" size="md" status="online" />
<.avatar initials="jd" color="info" variant="soft" />
<.avatar src="/images/jane.jpg" alt="Jane" gradient="sky-blue" size="lg" />
<.avatar kind="assistant" size="md" />
<.avatar_group more={3} size="sm">
<.avatar :for={user <- @users} name={user.name} color="auto" size="sm" ring />
</.avatar_group>size takes the names (3xs 16px, 2xs 20px, xs 24px, xs-plus 26px, sm 30px,
md 36px, lg 44px, xl 56px, 2xl 72px, sm-plus 32px) or any number of pixels
("40"). The legacy palette of the canvas is available with color t1..t5
(pastel tones), and color="none" leaves only the base lu-av face.
Summary
Functions
Attributes
src(:string) - Defaults tonil.alt(:string) - The picture's text; thenamewhen not given. Defaults tonil.initials(:string) - Shown (upper-cased) when there is nosrc. Defaults tonil.name(:string) - Gives the initials (first and last word) andcolor="auto". Defaults tonil.icon(:string) - An icon drawn on the sunken face. Defaults tonil.kind(:string) - Defaults tonil.Must be one ofnil,"company","customer","supplier","assistant", or"invite".size(:string) - A size name or a number of pixels. Defaults to"sm".shape(:string) - Defaults to"circle". Must be one of"circle","square","rounded","squircle","reuleaux-triangle","diamond","hexagon","hexagon-2","octagon","star","star-2", or"heart".tint(:string) - CSS color for the initials' background (white text). Defaults tonil.background(:string) - Any CSSbackgroundfor the face (white text). Defaults tonil.color(:string) - Defaults to"neutral". Must be one of"auto","neutral","primary","secondary","info","success","warning","error","t1","t2","t3","t4","t5", or"none".variant(:string) - Defaults to"solid". Must be one of"solid","soft","bordered", or"skeleton".status(:any) - Presence (online,away,busy,offline) or a tone;nil/falseshows no dot. Defaults tonil.status_position(:string) - Defaults tonil.Must be one ofnil,"bottom-left","bottom-right","top-left", or"top-right".ping(:boolean) - Animates the status dot. Defaults tofalse.ring(:any) -true,1,2or4. Defaults tofalse.ring_color(:string) - Defaults tonil.Must be one ofnil,"white","panel","neutral","primary","secondary","info","success","warning", or"error".face_class(:any) - Defaults tonil.gradient(:string) - Defaults tonil.Must be one ofnil,"sky-blue","amber-orange","pink-rose","purple-orange","green-fuchsia","purple-indigo", or"fuchsia-pink".style(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block- Replaces the initials (an icon, a counter).
Attributes
pulse(:boolean) - Defaults tofalse.overlap(:string) - Defaults to"2". Must be one of"2","3","7", or"auto".more(:integer) - Draws a "+N" avatar at the end. Defaults tonil.hidden(:list) - The people that did not fit (maps with:name, optional:src). Needsid. Defaults tonil.id(:string) - Defaults tonil.size(:string) - Defaults to"xs".spread(:boolean) - Defaults tofalse.ring_color(:string) - Defaults to"white". Must be one of"white", or"panel".label(:string) - Defaults tonil.class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)