Item
Rows of content that arrive one after another, with one highlight gliding between the rows you can open.
See it as an AI agent does.See this component the way an AI agent does.
Installation
npx shadcn@latest add @keyframery/itemThis adds components/keyframery/item.tsx and its primitive to your project, and installs UI SDK, along with agent-content, which it builds on. The motion tokens are added to your global CSS the first time you install a component.
Usage
import { Item, ItemActions, ItemContent, ItemDescription, ItemTitle } from "@/components/keyframery/item"
export default function Usage() {
return (
<Item variant="outline">
<ItemContent>
<ItemTitle>Weekly backup</ItemTitle>
<ItemDescription>Every Sunday at 2am</ItemDescription>
</ItemContent>
<ItemActions>On</ItemActions>
</Item>
)
}Anatomy
How the parts fit together:
Item
├── ItemContent
│ ├── ItemTitle
│ └── ItemDescription
└── ItemActionsExamples
An item with an action
Media, a title and a description on the left, whatever the row does on the right.
A list of links
Inside ItemGroup, rows rendered as links share one highlight that glides to the row under the pointer or the keyboard focus. Rows arrive one after another when the list mounts.
Header and footer
ItemHeader and ItemFooter take a full line above and below the row, for a picture or a status.
Motion
| Move | What you see |
|---|---|
| Cascade | Rows rise out of a soft blur one after another as the list mounts, and the lines between them draw out from the middle. |
| Glide | In a group, one highlight glides to the row under the pointer or the keyboard focus; the lines beside it step aside. |
| Press | A row that is a link or a button gives a little when pressed and springs back. |
| Fade | A photo in the media slot clears out of a blur as its row arrives. |
| Spring | A chevron in the actions leans toward where the row leads while it is hovered. |
Timing and springiness follow the motion style you set. To change how fast this item moves, pass speed:
<Item speed="fast">
…
</Item>"fast" is 0.6×, "slow" 1.4×, and a number sets the multiplier. With reduced motion turned on, nothing moves: changes happen at once or with a short fade.
Theming
Set these CSS variables on the component or a parent. Leave them unset to follow the light and dark theme. The open Customize panel below the preview lets you try these settings.
| Variable | What it changes | Default |
|---|---|---|
--item-face | Muted row surface | bg-muted/60 |
--item-ink | Row text | text-foreground |
--item-muted | Row details | text-muted-foreground |
--item-radius | Row corners | rounded-[12px] |
--item-font | Title size | text-[13.5px] |
--item-gap | Row gap | gap-3.5 |
--item-padding | Row padding | p-3.5 |
API reference
Every part takes className and children, along with the props of the element it renders. The parts are rendered by UI SDK, so they also take render, to draw your own element, and a function of their state for className and style.
Item
Renders a <div>, and takes its props too.
Prop
Type
ItemMedia
Renders a <div>, and takes its props too.
Prop
Type
ItemSeparator
Renders a <div>, and takes its props too.
Prop
Type
Other parts
These take the props of the element they render, and nothing else:
ItemContent: a<div>ItemTitle: a<div>ItemDescription: a<p>ItemActions: a<div>ItemFooter: a<div>ItemGroup: a<div>ItemHeader: a<div>
Keyboard
| Key | What it does |
|---|---|
| Tab | Moves to the next row that is a link or a button; the highlight follows. |
| Enter | Opens the focused row's link or presses its button. |
Accessibility
Roles, keyboard and focus are declared on the component's UI SDK primitive, and state is announced through the matching ARIA attributes. More in Accessibility.
Built on UI SDK's core
UI SDK doesn't ship a item, so this one is defined with its core: one definePrimitive in components/keyframery/core/item-core.ts, with no React in it. UI SDK's adapters can render that same definition in Vue, Svelte, Solid and web components. To keep your own styling and take only the motion, import from @/components/keyframery/primitives/item.
Questions
How does the animated Item for UI SDK move?
Cascade: Rows rise out of a soft blur one after another as the list mounts, and the lines between them draw out from the middle. Glide: In a group, one highlight glides to the row under the pointer or the keyboard focus; the lines beside it step aside. Press: A row that is a link or a button gives a little when pressed and springs back. Fade: A photo in the media slot clears out of a blur as its row arrives. Spring: A chevron in the actions leans toward where the row leads while it is hovered.
Do I need Motion or Framer Motion for the animated Item?
No. Every move is plain CSS, so there is nothing to install besides the component and UI SDK.
UI SDK has no item. How is this one built on UI SDK?
Its behaviour is one definition written with UI SDK's core (definePrimitive), in components/keyframery/core/item-core.ts. Its parts are rendered by UI SDK's adapter, so they take render, state-based class names and data-slot, like every UI SDK component.
What happens to the Item when someone turns on reduced motion?
Nothing moves. State changes happen at once, or with a short fade.
More in Display
All componentsDescription list
The label and value rows of a detail page, with real dl, dt and dd. Rows with a label column and hairlines, stacked, or a grid of two or three columns, reflowing to stacked on a phone by container queries. Values arrive in a short cascade, and a copy button copies its value and confirms on itself with a drawn check.
Kbd
Keyboard keys that sink and spring back when pressed, one after another for a combination.