apps/v4/content/docs/components/radix/item.mdx
The Item component is a straightforward flex container that can house nearly any type of content. Use it to display a title, description, and actions. Group it with the ItemGroup component to create a list of items.
npx shadcn@latest add item
<Step>Copy and paste the following code into your project.</Step>
<ComponentSource name="item" title="components/ui/item.tsx" styleName="radix-nova" />
<Step>Update the import paths to match your project setup.</Step>
</Steps> </TabsContent> </CodeTabs>import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
<Item>
<ItemMedia variant="icon">
<Icon />
</ItemMedia>
<ItemContent>
<ItemTitle>Title</ItemTitle>
<ItemDescription>Description</ItemDescription>
</ItemContent>
<ItemActions>
<Button>Action</Button>
</ItemActions>
</Item>
Use Field if you need to display a form input such as a checkbox, input, radio, or select.
If you only need to display content such as a title, description, and actions, use Item.
Use the variant prop to change the visual style of the item.
<ComponentPreview styleName="radix-nova" name="item-variant" previewClassName="h-96" />
Use the size prop to change the size of the item. Available sizes are default, sm, and xs.
<ComponentPreview styleName="radix-nova" name="item-size" previewClassName="h-96" />
Use ItemMedia with variant="icon" to display an icon.
You can use ItemMedia with variant="avatar" to display an avatar.
Use ItemMedia with variant="image" to display an image.
Use ItemGroup to group related items together.
<ComponentPreview styleName="radix-nova" name="item-group" previewClassName="h-96" />
Use ItemHeader to add a header above the item content.
<ComponentPreview styleName="radix-nova" name="item-header" previewClassName="h-96" />
Use the asChild prop to render the item as a link. The hover and focus states will be applied to the anchor element.
<Item asChild>
<a href="/dashboard">
<ItemMedia variant="icon">
<HomeIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Dashboard</ItemTitle>
<ItemDescription>Overview of your account and activity.</ItemDescription>
</ItemContent>
</a>
</Item>
To enable RTL support in shadcn/ui, see the RTL configuration guide.
<ComponentPreview styleName="radix-nova" name="item-rtl" direction="rtl" />The main component for displaying content with media, title, description, and actions.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "outline" | "muted" | "default" |
size | "default" | "sm" | "xs" | "default" |
asChild | boolean | false |
A container that groups related items together with consistent styling.
<ItemGroup>
<Item />
<Item />
</ItemGroup>
A separator between items in a group.
<ItemGroup>
<Item />
<ItemSeparator />
<Item />
</ItemGroup>
Use ItemMedia to display media content such as icons, images, or avatars.
| Prop | Type | Default |
|---|---|---|
variant | "default" | "icon" | "image" | "default" |
<ItemMedia variant="icon">
<Icon />
</ItemMedia>
<ItemMedia variant="image">
</ItemMedia>
Wraps the title and description of the item.
<ItemContent>
<ItemTitle>Title</ItemTitle>
<ItemDescription>Description</ItemDescription>
</ItemContent>
Displays the title of the item.
<ItemTitle>Item Title</ItemTitle>
Displays the description of the item.
<ItemDescription>Item description</ItemDescription>
Container for action buttons or other interactive elements.
<ItemActions>
<Button>Action</Button>
</ItemActions>
Displays a header above the item content.
<Item>
<ItemHeader>Header</ItemHeader>
<ItemContent>...</ItemContent>
</Item>
Displays a footer below the item content.
<Item>
<ItemContent>...</ItemContent>
<ItemFooter>Footer</ItemFooter>
</Item>