Skip to content
Logic2BUI

Search docs

Search components and documentation

New
Menu

Item

A flex container for a title, description and actions — group it with ItemGroup to build a list of composite entries.

Basic Item

A simple item with title and description.

Your profile has been verified.

Installation

npx logic2b@next add item

Usage

import {
  Item,
  ItemActions,
  ItemContent,
  ItemDescription,
  ItemMedia,
  ItemTitle,
} from "@/components/ui/item"
import { Button } from "@/components/ui/button"

<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>

Pass asChild to render the item as its child element (e.g. an <a>) instead of a div, so the whole row becomes a link while keeping the same layout.

Examples

Grouped, with separators and icon media

Wrap items in ItemGroup and drop an ItemSeparator between them for a settings-style list. ItemMedia variant="icon" gives the leading icon a muted square backdrop sized to match; variant="image" sizes and clips an <img> the same way for avatar-style media.

Notifications

Get notified about account activity.

Two-factor authentication

Require a code at every sign-in.

Billing alerts

Email me before a renewal charge.

Parts

Component Use for
Item The row/card root — a flex container that wraps everything else.
ItemGroup Visually groups items with neutral semantics; pair with ItemSeparator.
ItemSeparator A horizontal rule between grouped items.
ItemMedia Leading icon, image or avatar.
ItemContent Wraps ItemTitle + ItemDescription; multiple ItemContents in one Item stay non-growing.
ItemTitle The item’s title line.
ItemDescription Supporting text, clamped to 2 lines.
ItemActions Trailing buttons, switches or icons.
ItemHeader / ItemFooter Optional full-width rows above/below the main content.

Accessibility

ItemGroup is semantically neutral by default because not every composite group is a list. For true list content, pass role="list" to ItemGroup and role="listitem" to each Item. When an Item is interactive (a settings row that navigates, for example), pass asChild and render a real <a> or <button> as the child — don’t attach onClick to a bare <div>, which native input methods and screen readers won’t treat as actionable. Give every trailing icon button or switch its own accessible name.

Live playground

Edit the component props and inspect the exact JSX before copying it. The preview loads only when this section enters the viewport.

Generated JSX
<Item
  variant="outline"
  size="default"
>
  <ItemContent>
    <ItemTitle>Registry release</ItemTitle>
    <ItemDescription>Versioned source and accessibility metadata are ready.</ItemDescription>
  </ItemContent>
  <ItemActions>
    <span
      className="rounded-full bg-muted px-2 py-1 text-xs"
    >Ready</span>
  </ItemActions>
</Item>

API reference

Generated from the public TypeScript exports in src/ui/item.tsx.

View JSON

Item

Component
Props: React.ComponentProps<"div"> & VariantProps<typeof itemVariants> & { asChild?: boolean }
PropTypeRequiredDefaultDescription
variantnull | "default" | "outline" | "muted"No"default"—
sizenull | "default" | "sm"No"default"—
asChildbooleanNofalse—

ItemMedia

Component
Props: React.ComponentProps<"div"> & VariantProps<typeof itemMediaVariants>
PropTypeRequiredDefaultDescription
variantnull | "image" | "default" | "icon"No"default"—

ItemContent

Component
Props: React.ComponentProps<"div">

ItemActions

Component
Props: React.ComponentProps<"div">

ItemGroup

Component
Props: React.ComponentProps<"div">

ItemSeparator

Component
Props: React.ComponentProps<typeof Separator>

ItemTitle

Component
Props: React.ComponentProps<"div">

ItemDescription

Component
Props: React.ComponentProps<"p">

ItemHeader

Component
Props: React.ComponentProps<"div">

ItemFooter

Component
Props: React.ComponentProps<"div">

Accessibility contract

Machine-readable behavior and consumer responsibilities for item.

View JSON
Support
Composition contract
Pattern
content item
HTML div

Built-in semantics

  • Preserves the semantics of nested headings, links and buttons without imposing a role.

Consumer responsibilities

  • Choose list/listitem, article or link semantics at the composition boundary when the surrounding collection requires them.