- Accordion
- Alert
- Alert Dialog
- Aspect Ratio
- Attachment
- Avatar
- Badge
- Breadcrumb
- Bubble
- Button
- Button Group
- Card
- Checkbox
- Collapsible
- Combobox
- Context Menu
- Date Picker (Lite)
- Dialog
- Direction
- Drawer
- Dropdown Menu
- Empty
- Field
- Hover Card
- Input
- Input Group
- Input OTP (Lite)
- Item
- Kbd
- Label
- Marker
- Menubar
- Message
- Native Select
- Navigation Menu
- Pagination
- Popover
- Progress
- Radio Group
- Scroll Area
- Select
- Separator
- Sheet
- Sidebar
- Skeleton
- Slider
- Spinner
- Switch
- Table
- Tabs
- Textarea
- Toast
- Toggle
- Toggle Group
- Tooltip
A versatile component for displaying content with media, title, description, and actions.
A simple item with title and description.
import { BadgeCheckIcon, ChevronRightIcon } from "@/components/icons"
import { Button } from "@/components/ui/button"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function ItemDemo() {
return (
<div class="flex w-full max-w-md flex-col gap-6">
<Item variant="outline">
<ItemContent>
<ItemTitle>Basic Item</ItemTitle>
<ItemDescription>
A simple item with title and description.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
Action
</Button>
</ItemActions>
</Item>
<Item variant="outline" size="sm" render={<a href="#" />}>
<ItemMedia>
<BadgeCheckIcon class="size-5" />
</ItemMedia>
<ItemContent>
<ItemTitle>Your profile has been verified.</ItemTitle>
</ItemContent>
<ItemActions>
<ChevronRightIcon class="size-4" />
</ItemActions>
</Item>
</div>
)
}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.
Installation
pnpm dlx shadcnui-hono-jsx@latest add itemnpx shadcnui-hono-jsx@latest add itemyarn dlx shadcnui-hono-jsx@latest add itembunx shadcnui-hono-jsx@latest add itemUsage
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>Composition
Use the following composition to build an Item:
ItemGroup
└── Item
├── ItemHeader
├── ItemMedia
├── ItemContent
│ ├── ItemTitle
│ └── ItemDescription
├── ItemActions
└── ItemFooterItem vs Field
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.
Variant
Use the variant prop to change the visual style of the item.
Transparent background with no border.
Outlined style with a visible border.
Muted background for secondary content.
import { InboxIcon } from "@/components/icons"
import {
Item,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function ItemVariant() {
return (
<div class="flex w-full max-w-md flex-col gap-6">
<Item>
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Default Variant</ItemTitle>
<ItemDescription>
Transparent background with no border.
</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline">
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Outline Variant</ItemTitle>
<ItemDescription>
Outlined style with a visible border.
</ItemDescription>
</ItemContent>
</Item>
<Item variant="muted">
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Muted Variant</ItemTitle>
<ItemDescription>
Muted background for secondary content.
</ItemDescription>
</ItemContent>
</Item>
</div>
)
}Size
Use the size prop to change the size of the item. Available sizes are default, sm, and xs.
The standard size for most use cases.
A compact size for dense layouts.
The most compact size available.
import { InboxIcon } from "@/components/icons"
import {
Item,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function ItemSizeDemo() {
return (
<div class="flex w-full max-w-md flex-col gap-6">
<Item variant="outline">
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Default Size</ItemTitle>
<ItemDescription>
The standard size for most use cases.
</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline" size="sm">
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Small Size</ItemTitle>
<ItemDescription>A compact size for dense layouts.</ItemDescription>
</ItemContent>
</Item>
<Item variant="outline" size="xs">
<ItemMedia variant="icon">
<InboxIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Extra Small Size</ItemTitle>
<ItemDescription>The most compact size available.</ItemDescription>
</ItemContent>
</Item>
</div>
)
}Icon
Use ItemMedia with variant="icon" to display an icon.
New login detected from unknown device.
import { ShieldAlertIcon } from "@/components/icons"
import { Button } from "@/components/ui/button"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function ItemIcon() {
return (
<div class="flex w-full max-w-lg flex-col gap-6">
<Item variant="outline">
<ItemMedia variant="icon">
<ShieldAlertIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Security Alert</ItemTitle>
<ItemDescription>
New login detected from unknown device.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm" variant="outline">
Review
</Button>
</ItemActions>
</Item>
</div>
)
}Avatar
You can use ItemMedia with variant="avatar" to display an avatar.
ERLast seen 5 months ago
CN
LR
ERInvite your team to collaborate on this project.
import { Plus } from "@/components/icons"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
export function ItemAvatar() {
return (
<div class="flex w-full max-w-lg flex-col gap-6">
<Item variant="outline">
<ItemMedia>
<Avatar class="size-10">
<AvatarImage src="https://github.com/evilrabbit.png" />
<AvatarFallback>ER</AvatarFallback>
</Avatar>
</ItemMedia>
<ItemContent>
<ItemTitle>Evil Rabbit</ItemTitle>
<ItemDescription>Last seen 5 months ago</ItemDescription>
</ItemContent>
<ItemActions>
<Button
size="icon-sm"
variant="outline"
class="rounded-full"
aria-label="Invite"
>
<Plus />
</Button>
</ItemActions>
</Item>
<Item variant="outline">
<ItemMedia>
<div class="flex -space-x-2 *:data-[slot=avatar]:ring-2 *:data-[slot=avatar]:ring-background *:data-[slot=avatar]:grayscale">
<Avatar class="hidden sm:flex">
<AvatarImage src="https://github.com/shadcn.png" alt="@shadcn" />
<AvatarFallback>CN</AvatarFallback>
</Avatar>
<Avatar class="hidden sm:flex">
<AvatarImage
src="https://github.com/maxleiter.png"
alt="@maxleiter"
/>
<AvatarFallback>LR</AvatarFallback>
</Avatar>
<Avatar>
<AvatarImage
src="https://github.com/evilrabbit.png"
alt="@evilrabbit"
/>
<AvatarFallback>ER</AvatarFallback>
</Avatar>
</div>
</ItemMedia>
<ItemContent>
<ItemTitle>No Team Members</ItemTitle>
<ItemDescription>
Invite your team to collaborate on this project.
</ItemDescription>
</ItemContent>
<ItemActions>
<Button size="sm" variant="outline">
Invite
</Button>
</ItemActions>
</Item>
</div>
)
}Image
Use ItemMedia with variant="image" to display an image.
import {
Item,
ItemContent,
ItemDescription,
ItemGroup,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
const music = [
{
title: "Midnight City Lights",
artist: "Neon Dreams",
album: "Electric Nights",
duration: "3:45",
},
{
title: "Coffee Shop Conversations",
artist: "The Morning Brew",
album: "Urban Stories",
duration: "4:05",
},
{
title: "Digital Rain",
artist: "Cyber Symphony",
album: "Binary Beats",
duration: "3:30",
},
]
export function ItemImage() {
return (
<div class="flex w-full max-w-md flex-col gap-6">
<ItemGroup class="gap-4">
{music.map((song) => (
<Item
key={song.title}
variant="outline"
render={<a href="#" />}
role="listitem"
>
<ItemMedia variant="image">
<img
src={`https://avatar.vercel.sh/${song.title}`}
alt={song.title}
width={32}
height={32}
class="object-cover grayscale"
/>
</ItemMedia>
<ItemContent>
<ItemTitle class="line-clamp-1">
{song.title} -{" "}
<span class="text-muted-foreground">{song.album}</span>
</ItemTitle>
<ItemDescription>{song.artist}</ItemDescription>
</ItemContent>
<ItemContent class="flex-none text-center">
<ItemDescription>{song.duration}</ItemDescription>
</ItemContent>
</Item>
))}
</ItemGroup>
</div>
)
}Group
Use ItemGroup to group related items together.
sshadcn@vercel.com
mmaxleiter@vercel.com
eevilrabbit@vercel.com
import { PlusIcon } from "@/components/icons"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemGroup,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
const people = [
{
username: "shadcn",
avatar: "https://github.com/shadcn.png",
email: "shadcn@vercel.com",
},
{
username: "maxleiter",
avatar: "https://github.com/maxleiter.png",
email: "maxleiter@vercel.com",
},
{
username: "evilrabbit",
avatar: "https://github.com/evilrabbit.png",
email: "evilrabbit@vercel.com",
},
]
export function ItemGroupExample() {
return (
<ItemGroup class="max-w-sm">
{people.map((person, index) => (
<Item key={person.username} variant="outline">
<ItemMedia>
<Avatar>
<AvatarImage src={person.avatar} class="grayscale" />
<AvatarFallback>{person.username.charAt(0)}</AvatarFallback>
</Avatar>
</ItemMedia>
<ItemContent class="gap-1">
<ItemTitle>{person.username}</ItemTitle>
<ItemDescription>{person.email}</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="ghost" size="icon" class="rounded-full">
<PlusIcon />
</Button>
</ItemActions>
</Item>
))}
</ItemGroup>
)
}Header
Use ItemHeader to add a header above the item content.
Everyday tasks and UI generation.
Advanced thinking or reasoning.
Open Source model for everyone.
import {
Item,
ItemContent,
ItemDescription,
ItemGroup,
ItemHeader,
ItemTitle,
} from "@/components/ui/item"
const models = [
{
name: "v0-1.5-sm",
description: "Everyday tasks and UI generation.",
image:
"https://images.unsplash.com/photo-1650804068570-7fb2e3dbf888?q=80&w=640&auto=format&fit=crop",
credit: "Valeria Reverdo on Unsplash",
},
{
name: "v0-1.5-lg",
description: "Advanced thinking or reasoning.",
image:
"https://images.unsplash.com/photo-1610280777472-54133d004c8c?q=80&w=640&auto=format&fit=crop",
credit: "Michael Oeser on Unsplash",
},
{
name: "v0-2.0-mini",
description: "Open Source model for everyone.",
image:
"https://images.unsplash.com/photo-1602146057681-08560aee8cde?q=80&w=640&auto=format&fit=crop",
credit: "Cherry Laithang on Unsplash",
},
]
export function ItemHeaderDemo() {
return (
<div class="flex w-full max-w-xl flex-col gap-6">
<ItemGroup class="grid grid-cols-3 gap-4">
{models.map((model) => (
<Item key={model.name} variant="outline">
<ItemHeader>
<img
src={model.image}
alt={model.name}
width={128}
height={128}
class="aspect-square w-full rounded-sm object-cover"
/>
</ItemHeader>
<ItemContent>
<ItemTitle>{model.name}</ItemTitle>
<ItemDescription>{model.description}</ItemDescription>
</ItemContent>
</Item>
))}
</ItemGroup>
</div>
)
}Link
Use the render prop to render the item as a link. The hover and focus states will be applied to the anchor element.
import { ChevronRightIcon, ExternalLinkIcon } from "@/components/icons"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemTitle,
} from "@/components/ui/item"
export function ItemLink() {
return (
<div class="flex w-full max-w-md flex-col gap-4">
<Item render={<a href="#" />}>
<ItemContent>
<ItemTitle>Visit our documentation</ItemTitle>
<ItemDescription>
Learn how to get started with our components.
</ItemDescription>
</ItemContent>
<ItemActions>
<ChevronRightIcon class="size-4" />
</ItemActions>
</Item>
<Item
variant="outline"
render={<a href="#" target="_blank" rel="noopener noreferrer" />}
>
<ItemContent>
<ItemTitle>External resource</ItemTitle>
<ItemDescription>
Opens in a new tab with security attributes.
</ItemDescription>
</ItemContent>
<ItemActions>
<ExternalLinkIcon class="size-4" />
</ItemActions>
</Item>
</div>
)
}<Item render={<a href="/dashboard" />}>
<ItemMedia variant="icon">
<HomeIcon />
</ItemMedia>
<ItemContent>
<ItemTitle>Dashboard</ItemTitle>
<ItemDescription>Overview of your account and activity.</ItemDescription>
</ItemContent>
</Item>Dropdown
sshadcn@vercel.com
mmaxleiter@vercel.com
eevilrabbit@vercel.com
import { ChevronDownIcon } from "@/components/icons"
import { Avatar, AvatarFallback, AvatarImage } from "@/components/ui/avatar"
import { Button } from "@/components/ui/button"
import {
DropdownMenu,
DropdownMenuContent,
DropdownMenuGroup,
DropdownMenuItem,
DropdownMenuTrigger,
} from "@/components/ui/dropdown-menu"
import {
Item,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
const people = [
{
username: "shadcn",
avatar: "https://github.com/shadcn.png",
email: "shadcn@vercel.com",
},
{
username: "maxleiter",
avatar: "https://github.com/maxleiter.png",
email: "maxleiter@vercel.com",
},
{
username: "evilrabbit",
avatar: "https://github.com/evilrabbit.png",
email: "evilrabbit@vercel.com",
},
]
export function ItemDropdown() {
return (
<DropdownMenu>
<DropdownMenuTrigger render={<Button variant="outline" />}>
Select <ChevronDownIcon />
</DropdownMenuTrigger>
<DropdownMenuContent class="w-48" align="end">
<DropdownMenuGroup>
{people.map((person) => (
<DropdownMenuItem key={person.username}>
<Item size="xs" class="w-full p-2">
<ItemMedia>
<Avatar class="size-[--spacing(6.5)]">
<AvatarImage src={person.avatar} class="grayscale" />
<AvatarFallback>{person.username.charAt(0)}</AvatarFallback>
</Avatar>
</ItemMedia>
<ItemContent class="gap-0">
<ItemTitle>{person.username}</ItemTitle>
<ItemDescription class="leading-none">
{person.email}
</ItemDescription>
</ItemContent>
</Item>
</DropdownMenuItem>
))}
</DropdownMenuGroup>
</DropdownMenuContent>
</DropdownMenu>
)
}RTL
To enable RTL support in shadcn/ui, see the RTL configuration guide.
A simple item with title and description.
عنصر بسيط يحتوي على عنوان ووصف.
פריט פשוט עם כותרת ותיאור.
// This example sets dir and uses useTranslation because this site is not RTL.
// In an RTL app you won't need them; see the RTL guide.
import { BadgeCheckIcon, ChevronRightIcon } from "@/components/icons"
import {
type Translations,
useTranslation,
} from "@/components/language-selector"
import { Button } from "@/components/ui/button"
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemMedia,
ItemTitle,
} from "@/components/ui/item"
const translations: Translations = {
en: {
dir: "ltr",
values: {
basicItem: "Basic Item",
basicItemDesc: "A simple item with title and description.",
action: "Action",
verifiedTitle: "Your profile has been verified.",
},
},
ar: {
dir: "rtl",
values: {
basicItem: "عنصر أساسي",
basicItemDesc: "عنصر بسيط يحتوي على عنوان ووصف.",
action: "إجراء",
verifiedTitle: "تم التحقق من ملفك الشخصي.",
},
},
he: {
dir: "rtl",
values: {
basicItem: "פריט בסיסי",
basicItemDesc: "פריט פשוט עם כותרת ותיאור.",
action: "פעולה",
verifiedTitle: "הפרופיל שלך אומת.",
},
},
}
export function ItemRtl() {
const { dir, t } = useTranslation(translations, "ar")
return (
<div class="flex w-full max-w-md flex-col gap-6" dir={dir}>
<Item variant="outline" dir={dir}>
<ItemContent>
<ItemTitle>{t.basicItem}</ItemTitle>
<ItemDescription>{t.basicItemDesc}</ItemDescription>
</ItemContent>
<ItemActions>
<Button variant="outline" size="sm">
{t.action}
</Button>
</ItemActions>
</Item>
<Item variant="outline" size="sm" render={<a href="#" />} dir={dir}>
<ItemMedia>
<BadgeCheckIcon class="size-5" />
</ItemMedia>
<ItemContent>
<ItemTitle>{t.verifiedTitle}</ItemTitle>
</ItemContent>
<ItemActions>
<ChevronRightIcon class="size-4" />
</ItemActions>
</Item>
</div>
)
}Notes
renderis supported on the server (element or function), like Base UI.- Accepts
classinstead ofclassName. - Upstream documentation: shadcn/ui Item. See also Differences from shadcn/ui.
API Reference
Item
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" |
render | JSX element |
ItemGroup
A container that groups related items together with consistent styling.
<ItemGroup>
<Item />
<Item />
</ItemGroup>ItemSeparator
A separator between items in a group.
<ItemGroup>
<Item />
<ItemSeparator />
<Item />
</ItemGroup>ItemMedia
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">
<img src="..." alt="..." />
</ItemMedia>ItemContent
Wraps the title and description of the item.
<ItemContent>
<ItemTitle>Title</ItemTitle>
<ItemDescription>Description</ItemDescription>
</ItemContent>ItemTitle
Displays the title of the item.
<ItemTitle>Item Title</ItemTitle>ItemDescription
Displays the description of the item.
<ItemDescription>Item description</ItemDescription>ItemActions
Container for action buttons or other interactive elements.
<ItemActions>
<Button>Action</Button>
</ItemActions>ItemHeader
Displays a header above the item content.
<Item>
<ItemHeader>Header</ItemHeader>
<ItemContent>...</ItemContent>
</Item>ItemFooter
Displays a footer below the item content.
<Item>
<ItemContent>...</ItemContent>
<ItemFooter>Footer</ItemFooter>
</Item>