Item
A flexible row for media, title, description, and actions. Group items with ItemGroup and ItemSeparator.
Your profile has been verified.
Installation
The component is exported from @by/experience-system. Add the package with your package manager:
pnpm add @by/experience-systemIn this monorepo, depend on the workspace package (for example via workspace:* or your catalog) so imports resolve to packages/experience-system.
Composition
Use the following composition to build an Item row (see also shadcn/ui Item):
ItemGroup (optional)
├── ItemSeparator (optional, between rows)
└── Item
├── ItemHeader (optional)
├── ItemMedia (optional)
├── ItemContent
│ ├── ItemTitle
│ └── ItemDescription
├── ItemActions (optional)
└── ItemFooter (optional)Item vs Field: use Field (and form primitives) when the row centers on an input, checkbox, radio, or select. Use Item for read-only or action-oriented rows (navigation, summaries, list cells). With asChild on Item, the row merges onto a single child via Radix UI Slot.
Usage
import {
Item,
ItemActions,
ItemContent,
ItemDescription,
ItemGroup,
ItemHeader,
ItemMedia,
ItemSeparator,
ItemTitle,
} from '@by/experience-system';Item and its parts are client components ('use client' in the package). Use them inside a Client Component or a dynamic import when using the Next.js App Router.
<Item variant="outline">
<ItemMedia variant="icon">{/* icon */}</ItemMedia>
<ItemContent>
<ItemTitle>Title</ItemTitle>
<ItemDescription>Supporting text.</ItemDescription>
</ItemContent>
<ItemActions>{/* buttons */}</ItemActions>
</Item>Examples
The live preview at the top of this page uses item-usage.
Variants
Surface styles for the whole row: default (transparent), outline (border), soft (subtle fill).
Transparent background with no border.
Outlined style with a visible border.
Soft background for secondary content.
Sizes
Use the size prop on Item for md, sm, or xs padding and density.
The baseline size for most use cases (`md`).
A compact size for dense layouts.
The most compact size available.
With icon
Use ItemMedia with variant="icon" for a contained icon well.
New login detected from unknown device.
Image
Use ItemMedia with variant="image" for thumbnails (for example album art). Rows can be asChild links.
Group
ItemGroup sets role="list"; add role="listitem" on each Item when it represents a list row. Use ItemSeparator between rows.
With paddings
shadcn@vercel.com
maxleiter@vercel.com
evilrabbit@vercel.com
Without paddings
shadcn@vercel.com
maxleiter@vercel.com
evilrabbit@vercel.com
Header
Use ItemHeader for content above the main body (for example a cover image), then ItemContent with ItemTitle and ItemDescription.
Everyday tasks and UI generation.
Advanced thinking or reasoning.
Open Source model for everyone.
Link
Item with asChild wraps an anchor so focus and hover styles apply to the link. Pair with ItemActions for trailing affordances (chevron, external icon).
API Reference
Subsection titles name the exports from @by/experience-system. Item uses Radix UI Slot when asChild is true. ItemSeparator wraps the Experience System Separator (Radix Separator under the hood).
Item
Root row.
| Prop | Type | Default |
|---|---|---|
variant | default | outline | muted | — |
size | default | sm | xs | — |
asChild | boolean | false |
className | string | — |
Also accepts standard div attributes.
| Data attribute | Values |
|---|---|
data-slot | item |
data-variant | mirrors variant when set |
data-size | mirrors size when set |
ItemGroup
Vertical stack for related items.
| Data attribute | Values |
|---|---|
data-slot | item-group |
Renders role="list". Also accepts standard div attributes.
ItemSeparator
Horizontal rule between items.
| Data attribute | Values |
|---|---|
data-slot | item-separator |
Forwards to Separator with orientation="horizontal". Also accepts Separator props where applicable.
ItemMedia
Leading media slot.
| Prop | Type | Default |
|---|---|---|
variant | default | icon | image | avatar | — |
className | string | — |
| Data attribute | Values |
|---|---|
data-slot | item-media |
data-variant | mirrors variant |
Also accepts standard div attributes.
ItemContent
Main column; typically holds ItemTitle and ItemDescription.
| Data attribute | Values |
|---|---|
data-slot | item-content |
ItemTitle
Primary line (div).
| Data attribute | Values |
|---|---|
data-slot | item-title |
Also accepts standard div attributes.
ItemDescription
Secondary line (renders a p).
| Data attribute | Values |
|---|---|
data-slot | item-description |
Also accepts standard p attributes.
ItemActions
End-aligned actions (buttons, icons, menus).
| Data attribute | Values |
|---|---|
data-slot | item-actions |
ItemHeader
Optional block above ItemContent.
| Data attribute | Values |
|---|---|
data-slot | item-header |
ItemFooter
Optional metadata below ItemContent.
| Data attribute | Values |
|---|---|
data-slot | item-footer |
Accessibility
- Keep a single
ItemTitle(or equivalent heading) per row for a clear scan order. - Decorative icons in
ItemMediaorItemActionsshould usearia-hidden; meaningful icons need an accessible name. - When
ItemGroupis a list, mark eachItemwithrole="listitem"if the DOM structure does not already imply list items. - For
asChildlinks, ensure the childahas a visible focus ring (handled viaItemstyles) and descriptive link text.
Source in the repo: packages/experience-system/src/components/Item/Item.tsx and variants.ts. Agent-oriented usage notes: packages/experience-system/src/components/Item/Item.instructions.md.