Skip to content
shadcn.io

shadcn.io is not affiliated with official shadcn/ui

Item examples · Layout

Item Sizes for React

A default-size item with an action button above a small item rendered as a link with an icon.

Framework
UI library

Item comes in three densities, and this React example shows the two most common side by side. The first row is the default size, with a title, a description and an outline Action Button. The second is size="sm", rendered as a link, with a verified badge icon in ItemMedia, a title and a chevron. Both use the outline variant on a bg-background row.

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 I use size sm instead of the default?

Use the default for primary lists where each row has a title and a description. Use sm for denser places: sidebars, menus, settings with many rows, or one-line rows like the second one here. xs goes further for very compact menus.

How does size affect ItemMedia?

The image variant of ItemMedia steps down with the Item's size, to size-8 at sm and size-6 at xs. Icons and avatars keep their own size, so the example sets size-5 on the badge icon itself.

Should the actions scale with the Item's size?

Pick a matching size yourself; Item doesn't resize what you put in ItemActions. The default row uses a sm button so it doesn't make the row taller, and the small row only has a decorative chevron.

Can an Item change size between mobile and desktop?

size is a prop, not a responsive class, so pick one per list. If you need different spacing on small screens, override the padding with responsive classes on the Item, or render the list with a different size depending on the layout.

Can a size sm Item have an ItemDescription?

Yes. sm only reduces the gap and padding; the description keeps its size and its two-line clamp. At xs the content's gap goes away, and most styles also shrink the description text.

Are small Items still accessible?

The text size doesn't change at sm, so readability is the same; only the padding shrinks. When the row is a link or holds a button, keep the target comfortably large to tap, and keep visible text in the row so the link has a name.