Item

A row of media, a title, a description and actions, alone or in a list.

View as Markdown
Basic Item

A simple item with title and description.

Your profile has been verified.
<Item variant="outline">  <ItemContent>    <ItemTitle>Basic Item</ItemTitle>    <ItemDescription>A simple item with title and description.</ItemDescription>  </ItemContent>  <ItemActions>    <Button size="sm" variant="outline">      Action    </Button>  </ItemActions></Item>

Installation

$ npx shadcn@latest add @constella/item

Usage

import {  Item,  ItemActions,  ItemContent,  ItemDescription,  ItemMedia,  ItemTitle,} from "@/components/primitives/item";
<Item>  <ItemMedia variant="icon">    <HugeiconsIcon icon={Notification01Icon} />  </ItemMedia>  <ItemContent>    <ItemTitle>Title</ItemTitle>    <ItemDescription>Description</ItemDescription>  </ItemContent>  <ItemActions>    <Button>Action</Button>  </ItemActions></Item>

Composition

ItemGroup├── Item│   ├── ItemHeader│   ├── ItemMedia│   ├── ItemContent│   │   ├── ItemTitle│   │   └── ItemDescription│   ├── ItemActions│   └── ItemFooter└── ItemSeparator

Variant

Use the variant prop on Item to set its surface.

Default Variant

Standard styling with subtle background and borders.

Outline Variant

Standard styling with subtle background and borders.

Secondary Variant

Standard styling with subtle background and borders.

VariantSurface
defaultNone
outlineA border edge
secondaryA fillSubtle fill
<Item variant="outline">…</Item>

Size

Use the size prop on Item to set its padding and its media's size.

Default Size

New messages land here.

Small Size

New messages land here.

Extra Small Size

New messages land here.

SizePaddingImage
default10px × 12px40px
sm10px × 12px32px
xs8px × 10px24px
<Item size="sm">…</Item>

With Icon

Use ItemMedia with variant="icon" for an icon. With a description, the media lines up with the title.

Security Alert

New login detected from unknown device.

<ItemMedia variant="icon">  <HugeiconsIcon icon={Shield01Icon} /></ItemMedia>

Item Group

Use ItemGroup for a list of items, and ItemSeparator between them.

CN
shadcn

shadcn@acme.com

EK
emilkowalski

emilkowalski@acme.com

ER
evilrabbit

evilrabbit@acme.com

<ItemGroup>  <Item>…</Item>  <ItemSeparator />  <Item>…</Item></ItemGroup>

Item Header

Use ItemHeader and ItemFooter for full-width rows above and below the content, like a title with a tag and a footer with a date and an action.

v0.9.0
Latest

Hover cards glide between triggers.

Today
v0.8.0

Data tables, sidebars and the chat parts.

Last week
<Item variant="outline">  <ItemHeader>    <ItemTitle>v0.9.0</ItemTitle>    <Badge variant="secondary">Latest</Badge>  </ItemHeader>  <ItemContent>    <ItemDescription>Hover cards glide between triggers.</ItemDescription>  </ItemContent>  <ItemFooter>    Today    <Button size="sm" variant="ghost">      Read notes    </Button>  </ItemFooter></Item>

Use the render prop to render an item as a link. Only a link or a button answers hover and press.

<Item render={<a href="/docs" />}>  <ItemContent>    <ItemTitle>Visit our documentation</ItemTitle>  </ItemContent></Item>

Avatar

Put an Avatar in ItemMedia. Use variant="image" for a plain <img>, which fills the media box.

CN
shadcn

Last seen 5 months ago

<ItemMedia>  <Avatar size="lg">    <AvatarImage alt="" src="/avatars/shadcn.png" />    <AvatarFallback>CN</AvatarFallback>  </Avatar></ItemMedia>

API Reference

PartAdds
Itemvariant: "default", "outline" or "secondary"; size: "default", "sm" or "xs"; render
ItemMediavariant: "default", "icon" or "image"
ItemTitlerender, to make it a heading: render={<h3 />}

Every part takes sx, applied last. For render, see Base UI useRender.