View fulldotdev/ui on GitHub

Item

A flexible container for displaying content items with various styles.

Installation

npx shadcn@latest add @fulldev/item

Usage

import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemMedia,
  ItemTitle,
} from "@/components/ui/item"
<Item>
  <ItemMedia variant="icon">
    <InboxIcon />
  </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

Item vs Field

Use Field for a form input such as a checkbox, input, radio or select. Use Item to display content such as a title, description and actions.

Variant

Use the variant prop to change the visual style of the item.

Size

Use the size prop to change the size of the item: default, sm or xs.

Icon

Use ItemMedia with variant="icon" to display an icon.

Avatar

Image

Use ItemMedia with variant="image" to display an image.

Group

Use ItemGroup to group related items together.

Use ItemHeader to add a header above the item content.

Pass href to render the item as an a. The hover and focus states apply to the link.

RTL

API Reference

Source: src/components/ui/item

Item

PropTypeDefault
variant"default" | "outline" | "muted""default"
size"default" | "sm" | "xs""default"
hrefstring

Item renders a div, or an a when you pass href. It writes data-variant and data-size. ItemGroup renders a div with role="list".

ItemMedia

PropTypeDefault
variant"default" | "icon" | "image""default"