shadcn.io is not affiliated with official shadcn/ui
Item examples · Media
Item with Avatar for React
An outline item with a person's avatar, name and last-seen time, and a round invite button.
A person row: who they are, when they were last around, and one thing you can do. This React example puts a large Avatar in ItemMedia, the name and Last seen 5 months ago in ItemContent, and a round outline icon Button with a plus in ItemActions. The button is pill and icon-sm, and its aria-label says Invite.
Preview
Installation
FAQ
What size should an avatar be in an Item?
Use Avatar's size prop. This row uses lg, next to a title and a description. ItemMedia does not resize the avatar, so the prop decides.
When does AvatarFallback show, and what should it say?
It shows when the picture can't be displayed, for example on a broken URL. Use the person's initials, HB here, so the row still identifies them.
Why an icon-only plus button?
The row already names the person, so a plus reads as add or invite them without taking room from the text. An icon-only button needs an aria-label; in a list, name the person too, such as Invite Hayden Bleasel, so each button is distinct.
What does the invite button use?
pill, size="icon-sm", and variant="outline". aria-label is Invite, and PlusIcon is aria-hidden. The row itself is variant="outline" with bg-background.
Related
- Item GroupThree people in an item group, divided by
- Item in DropdownA Select button that opens a menu of
- Item with Icon MediaA security alert item with a shield icon
- Item with Image MediaA list of songs as link items, each with
- Avatar StandardA round avatar with a profile picture and
- Item as LinkTwo items rendered as links: one to a