Item
A versatile list item with media, content, and actions.
When to Use
Use Item when you need to:
- Display structured content with a title, description, and optional actions
- Build list-style layouts such as notifications, contacts, or settings
- Combine media (icons, avatars, images) with text content
- Create clickable list rows using the asChild pattern
- Group related rows with separators using ItemGroup
When Not to Use
- Form inputs with labels and validation - use Field
- Rich content containers with headers and footers - use Card
- Simple key-value display - use a description list or Table
- Navigation menus with submenus - use Navigation Menu
Default
Basic item with content, description, and actions.
A simple item with title and description.
Variants
Different visual styles: default, outline, and muted.
Standard styling with transparent background.
Outlined style with clear borders.
Subdued appearance for secondary content.
Sizes
Default and small size options for different layouts.
Standard padding and gap spacing.
Compact padding for dense layouts.
With Icon
Items with icon media using the icon variant for bordered icon containers.
New login detected from unknown device.
You have 3 unread notifications.
With Avatar
Items displaying user avatars and avatar groups.
Last seen 5 months ago
3 people are collaborating on this project.
As Link
Render items as clickable links using asChild. Hover state is automatically applied.
Item Group
Group items with separators for structured lists.
shadcn@vercel.com
maxleiter@vercel.com
evilrabbit@vercel.com
UX & Design Guidelines
Visual Hierarchy
Use variant="outline" for prominent list rows, variant="default" for minimal emphasis, and variant="muted" for secondary or read content. Lead with media (icons or avatars) to aid scanning. Place primary actions on the right via ItemActions.
Spacing & Layout
Default size uses p-4 gap-4 for comfortable spacing. Use size="sm" (py-3 px-4 gap-2.5) for dense layouts like notification lists or settings panels. When grouping items, use ItemGroup with ItemSeparator for consistent dividers.
Responsive Behavior
Items flex-wrap by default, so content reflows naturally on narrow screens. On mobile, consider hiding secondary actions behind a dropdown or using size="sm" to conserve vertical space. ItemDescription is capped at 2 lines via line-clamp-2 to prevent overflow.
Color & Contrast
ItemTitle uses text-foreground with font-medium for clear hierarchy. ItemDescription uses text-muted-foreground for secondary emphasis. The outline variant uses border-border which adapts to light and dark modes automatically.
Accessibility
Keyboard Navigation
- Tab -- Move focus to the item or its interactive children
- Enter -- Activate a linked item (when using asChild with an anchor)
- Space -- Activate action buttons within ItemActions
- Escape -- Return focus to the item when an action popover is open
Screen Reader Support
- ItemGroup renders with
role="list"by default for semantic grouping - Add
role="listitem"to each Item inside a group for proper list semantics - Icon-only action buttons require
aria-labelfor screen reader users - Linked items should use descriptive text or
aria-labelso the destination is clear
Focus Management
Visible focus ring with 3px width using focus-visible:ring-[3px]. Focus states use focus-visible:border-ring and focus-visible:ring-ring/50 to meet WCAG 2.1 Level AA requirements. When using asChild with links, focus travels naturally through the anchor element.
Touch Targets
Default items have p-4 padding, providing ample touch area. Small items use py-3 px-4, still meeting the 44px minimum height recommendation. Linked items (asChild) make the entire row tappable for easier mobile interaction.
ARIA Attributes
{/* Item group with list semantics */}
<ItemGroup role="list">
<Item role="listitem">
<ItemContent>
<ItemTitle>First item</ItemTitle>
</ItemContent>
</Item>
</ItemGroup>
{/* Icon-only actions need aria-label */}
<Item variant="outline">
<ItemContent>
<ItemTitle>Notification</ItemTitle>
</ItemContent>
<ItemActions>
<Button size="icon" variant="ghost" aria-label="Dismiss notification">
<X className="size-4" />
</Button>
</ItemActions>
</Item>
{/* Linked item with descriptive accessible name */}
<Item asChild>
<a href="/settings" aria-label="Open account settings">
<ItemMedia variant="icon">
<Settings />
</ItemMedia>
<ItemContent>
<ItemTitle>Settings</ItemTitle>
<ItemDescription>Manage your account preferences</ItemDescription>
</ItemContent>
</a>
</Item>Related Components
API Reference
The Item component accepts the following props in addition to standard div attributes.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "outline" | "muted" | "default" | The visual style variant of the item. |
| size | "default" | "sm" | "default" | The size of the item padding and gap spacing. |
| asChild | boolean | false | When true, the item renders its child as the root element, merging props and behavior. |
| className | string | — | Additional CSS classes to apply to the item. |
ItemMedia
Container for icons, images, or avatars displayed alongside item content.
| Prop | Type | Default | Description |
|---|---|---|---|
| variant | "default" | "icon" | "image" | "default" | Style variant for different media types. Icon adds a bordered box; image adds overflow clipping. |
| className | string | — | Additional CSS classes to apply to the media container. |
ItemGroup
Container for grouping related items with semantic list structure.
| Prop | Type | Default | Description |
|---|---|---|---|
| role | string | "list" | ARIA role for the group container. Defaults to list for semantic list behavior. |
| className | string | — | Additional CSS classes to apply to the group container. |