LineOne's 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 src="/images/jane.jpg" alt="Jane" />
<.avatar initials="jd" color="primary" size="md" shape="square" />
<.avatar initials="jd" color="info" variant="soft" />
<.avatar src="/images/jane.jpg" size="lg" status="success" />
<.avatar initials="jd" status="primary" status_position="bottom-left" ping />
<.avatar src="/images/jane.jpg" gradient="sky-blue" size="lg" />
<.avatar_group>
<.avatar :for={user <- @users} src={user.photo} size="xs" ring />
</.avatar_group>
<.avatar src="/images/jane.jpg" size="2xs" ring={1} ring_color="primary" />
<.avatar src="/images/jane.jpg" size="lg" face_class="border-2 border-white dark:border-navy-700" />
<.avatar src="/images/jane.jpg" status="success" status_position="bottom-right" />The inner block, when given, replaces the initials (an icon, a counter).
Summary
Functions
Renders an avatar.
Stacks avatars so they overlap, as LineOne's avatar group. Give the avatars ring so each
one is outlined against the next.
Functions
Renders an avatar.
Attributes
src(:string) - Defaults tonil.alt(:string) - Defaults to"avatar".initials(:string) - Shown (upper-cased) when there is nosrc. Defaults tonil.size(:string) -3xsis size-6,2xssize-7,xssize-8,xs-plussize-9,smsize-10 (default),mdsize-12,lgsize-16,xlsize-20,2xlsize-24. Defaults to"sm". Must be one of"3xs","2xs","xs","xs-plus","sm","md","lg","xl", or"2xl".shape(:string) -squareis LineOne'srounded-lg,roundeditsrounded-xl; the others are masks. Defaults to"circle". Must be one of"circle","square","rounded","squircle","reuleaux-triangle","diamond","hexagon","hexagon-2","octagon","star","star-2", or"heart".color(:string) - The initials' color. Defaults to"neutral". Must be one of"neutral","primary","secondary","info","success","warning", or"error".variant(:string) - How the initials are painted;skeletonis the grey placeholder. Defaults to"solid". Must be one of"solid","soft","bordered", or"skeleton".status(:any) - A status dot's color;nilorfalseshows no dot. Works the same on an image and on initials. Usestatus_position="bottom-right"for LineOne's online dot. Defaults tonil. Must be one ofnil,false,"neutral","primary","secondary","info","success","warning", or"error".status_position(:string) - Defaults to"top-right". Must be one of"top-right","top-left","bottom-right", or"bottom-left".ping(:boolean) - Animates the status dot with a ping. Defaults tofalse.ring(:any) - The ring avatars wear inside a group.trueis a 2px ring;1,2or4pick the width. Defaults tofalse. Must be one oftrue,false,1,2,4,"1","2", or"4".ring_color(:string) -whiteis white in light mode and the card color in dark mode. Defaults to"white". Must be one of"white","neutral","primary","secondary","info","success","warning", or"error".face_class(:any) - Classes merged into the picture or initials face itself (a border, a shadow), whileclassgoes on the wrapper. Defaults tonil.gradient(:string) - A gradient border around the avatar. Defaults tonil. Must be one ofnil,"sky-blue","amber-orange","pink-rose","purple-orange","green-fuchsia","purple-indigo", or"fuchsia-pink".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block
Stacks avatars so they overlap, as LineOne's avatar group. Give the avatars ring so each
one is outlined against the next.
<.avatar_group>
<.avatar src="/a.jpg" size="xs" ring />
<.avatar initials="jd" color="info" size="xs" ring />
</.avatar_group>Attributes
pulse(:boolean) - Pulses the whole group, for skeletons. Defaults tofalse.overlap(:string) - How far the avatars overlap:2is-space-x-2,3is-space-x-3. Defaults to"2". Must be one of"2", or"3".class(:any) - Defaults tonil.- Global attributes are accepted.
Slots
inner_block(required)