Skip to content
shadcn.io

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.

Framework
UI library

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

Preview width

Installation

Sign in to get your install command
Free with an account. It carries your token, so the CLI installs everything in one go.

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.

Why is the row outline with a background?

variant="outline" draws the border, and className="bg-background" fills the row so that border reads on a tinted surface. The link is size="sm".

Are clickable Items with icons accessible?

Yes: the row is one anchor named by its title, both icons are hidden from screen readers, and the link takes focus with Tab and opens with Enter. Keep the title meaningful on its own, since it's all a screen reader announces.