Fusuma

Components / Composite

avatar_group

Avatars for names (initials are taken from each), size pixels across, at most max of them and a +n for the rest.

Try it

This is the Bars page of the gallery, running in your browser: avatar_group is on it, and it is the real widget. Press Run, then use it.

Live: Bars, where avatar_group is usedOpen full size

Also on this pagetop_bartoolbaricon_badgefabsearch_barmarksnavigation_bartoggle_groupchip_groupbutton_group

Avatars for names (initials are taken from each), size pixels across, at most max of them and a +n for the rest.

When there are more names than max, the last avatar says how many more ("+3").

Signature

pub const fn avatar_group<'a>( names: &'a [&'a str], size: u32, max: usize, ) -> AvatarGroup<'a>

Example

use fusuma::avatar_group;
let view = avatar_group(&["Ada Lovelace", "Grace Hopper", "Linus Torvalds", "Margaret Hamilton"], 24, 3);
let built = fusuma::doc::built::<(), _>(&view);
assert!(built.texts().contains(&"AL"));

All components · Source