shadcn.io is not affiliated with official shadcn/ui
Item examples · Standard
Item with Media and Icon for React
A small link item with a verified badge icon, a one-line message and a chevron.
A one-line notice you can click: Your profile has been verified, with a badge check before it and a chevron after. This React example renders a sm, outline Item as a link, with the icon in ItemMedia, the message in ItemTitle and the chevron in ItemActions.
Preview
Installation
FAQ
When should an Item include ItemMedia?
When a picture or icon tells people what kind of row it is before they read it, as this badge does for a verified profile. Leave it out when the title is the whole story.
How is the whole Item made clickable?
The Item renders as an anchor, so the entire row is one link with a hover background and a focus ring.
Pass the anchor to render.
Why a chevron in ItemActions?
A trailing chevron is the usual hint that the row opens another page. It's decorative, marked aria-hidden="true", because the link itself already says it's a link. Use an external-link icon instead when the row leaves your site.
What does size sm do here?
It reduces the Item's gap and padding, which suits a one-line row without a description. The text size stays the same. The icon keeps its own size-5, since ItemMedia's default variant doesn't size icons.
Related
- Basic ItemAn outline item with a title, a one-line
- Item SizesA default-size item with an action button
- Item as LinkTwo items rendered as links: one to a
- Item with Icon MediaA security alert item with a shield icon
- Standard with Title AlertA neutral alert with only a title, for a
- Badge with Text (Standard)A default badge with a short label for a