Skip to content

Item

Download .md

An item is a row in a list: a picture or icon, a title, one line of description and an action, such as an artist in a list or a setting in a menu.

  • Use it for lists on phones and in panels: artists, releases, account menus, settings.
  • Use a Table for records with many columns that people compare.
  • Make the whole row a link when it opens a page; keep a separate button when the row has its own action.
  • Item is the row of the Mobile app pattern.
React
RS
Rara Senandika

3 rilis · Pop

BL
Bima Laras

5 rilis · Folk

NK
Nada Kirana

2 rilis · R&B

Vue
RS
Rara Senandika

3 rilis · Pop

BL
Bima Laras

5 rilis · Folk

NK
Nada Kirana

2 rilis · R&B

1234
  1. 1Leading avatar or icon
  2. 2Title and meta
  3. 3Trailing chevron
  4. 4Divider

A row on radius-lg with p-3 and a 12px gap: media on the left (an Avatar or a 40px icon), the title (text-sm font-medium) and description (text-sm text-muted-foreground), then actions on the right. As a link, it turns accent on hover.

Variant Use it for
default Rows in a menu or a list with separators.
outline Rows that stand on their own, such as cards in a list.
muted A row that needs a quiet surface, such as a summary.
React Vue Flutter Type Default Use
variant variant ShadItem / .outline / .muted text default The look.
size size size default, sm, xs (React only) default The padding.
render={<a href />} as-child with a link onPressed element div Makes the whole row a link.
ItemMedia, ItemTitle, ItemDescription, ItemActions same media, title, description, actions element none The parts of the row.
import { Avatar, AvatarFallback } from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import { Item, ItemActions, ItemContent, ItemDescription, ItemGroup, ItemMedia, ItemTitle } from "@/components/ui/item"
const artists = [
{ name: "Rara Senandika", initials: "RS", detail: "3 rilis · Pop" },
{ name: "Bima Laras", initials: "BL", detail: "5 rilis · Folk" },
{ name: "Nada Kirana", initials: "NK", detail: "2 rilis · R&B" },
]
export default function ItemDemo() {
return (
<ItemGroup className="w-full max-w-md gap-2">
{artists.map((artist) => (
<Item key={artist.name} variant="outline">
<ItemMedia>
<Avatar>
<AvatarFallback>{artist.initials}</AvatarFallback>
</Avatar>
</ItemMedia>
<ItemContent>
<ItemTitle>{artist.name}</ItemTitle>
<ItemDescription>{artist.detail}</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm" aria-label={`Lihat ${artist.name}`}>
Lihat
</Button>
</ItemActions>
</Item>
))}
</ItemGroup>
)
}
Terminal window
npx shadcn@latest add https://design.sosialoka.tech/r/react/item.json
  • Name each action with what it acts on: “Lihat Rara Senandika”, not only “Lihat”.
  • When the whole row is a link, don’t nest another button inside it.
  • Put items in a list (ItemGroup) so screen readers announce how many there are.