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.
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
Installation
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.
Related
- Basic ItemAn outline item with a title, a one-line
- Item with Media and IconA small link item with a verified badge
- Item GroupThree people in an item group, divided by
- Item as LinkTwo items rendered as links: one to a
- Item in DropdownA Select button that opens a menu of
- Item with HeaderThree model cards in a grid, each an item