Skip to content
Components

Item

BetaBeta — the props contract is close to final, but small breaking changes can still land.

List row with media, content, and trailing actions.

Composition

Grouped content rows

  • <ItemGroup>
    • <Item>
      • <ItemHeader />
      • <ItemMedia />
      • <ItemContent>
        • <ItemTitle />
        • <ItemDescription />
        </ItemContent>
      • <ItemActions />
      • <ItemFooter />
      </Item>
    • <ItemSeparator />
    </ItemGroup>

Selectable, draggable rows

Rows with role="option", "treeitem", "row" or "menuitem" get the hover fill. aria-selected="true" paints the selected fill; set data-dragging on the row being dragged and data-drop-target on the row under it. The host owns selection, keyboard movement and the drag logic.

  • <ItemGroup>
    • <Item>
      • <ItemMedia />
      • <ItemContent>
        • <ItemTitle />
        </ItemContent>
      </Item>
    </ItemGroup>

Installation

The Control UI source installs this component from src/registry/sources/control-ui/ui/item.tsx.

Registry command
See registry manifest

Dependencies

Raw code

Primary installed source

src/registry/sources/control-ui/ui/item.tsx

Knobs

Typed custom properties the recipe paints with. Set one on the root — style, a utility class, or a skin — and every slot inherits it.

--cui-item-* · 19 knobsHow the cascade resolves
--cui-item-radius<length-percentage>var(--radius-control)
--cui-item-media-icon-size<length-percentage>calc(var(--spacing) * 5)
--cui-item-hover-background<color>var(--hover-fill)
--cui-item-current-background<color>var(--active-fill)
--cui-item-foreground<color>var(--foreground)
--cui-item-selected-background<color>var(--cui-item-current-background)
--cui-item-selected-foreground<color>var(--cui-item-foreground)
--cui-item-dragging-opacity<number>0.5
--cui-item-drop-target-shadow*inset 0 0 0 var(--focus-ring-width) var(--primary)
--cui-item-hover-border-color<color>var(--_item-border-color)
--cui-item-border-width<length>0px
--cui-item-active-scale<number>0.99
--cui-item-gap<length-percentage>calc(var(--spacing) * 3)
--cui-item-padding-block<length-percentage>calc(var(--spacing) * 3)
--cui-item-padding-inline<length-percentage>calc(var(--spacing) * 3)
--cui-item-description-font-size<length-percentage>var(--text-body)
--cui-item-description-line-height<number>var(--leading-relaxed)
--cui-item-description-foreground<color>var(--muted-foreground)
--cui-item-media-foreground<color>var(--muted-foreground)