# Item

A composable content row for media, titles, descriptions, metadata, and actions.

Item presents a compact piece of content with optional media and actions. Use it for settings rows,
resource summaries, navigation destinations, and other content that is smaller than a Card but does
not have form-control semantics.

```tsx
import { ShieldPlusIcon } from "@phosphor-icons/react";
import { Button, Item } from "@zentara-co/zenos-ui";

function ItemExample() {
  return (
    <Item variant="outline" className="w-full max-w-xl">
      <Item.Media variant="icon">
        <ShieldPlusIcon aria-hidden="true" />
      </Item.Media>
      <Item.Content>
        <Item.Title>Workspace protection is active</Item.Title>
        <Item.Description>Security scans run automatically before every release.</Item.Description>
      </Item.Content>
      <Item.Actions>
        <Button size="sm" variant="primary">
          Review
        </Button>
      </Item.Actions>
    </Item>
  );
}
```

## Import

```tsx
import { Item } from "@zentara-co/zenos-ui";
```

## Composition

Build an Item from only the parts the content needs.

```tsx
<Item>
  <Item.Header>Account</Item.Header>
  <Item.Media variant="icon">...</Item.Media>
  <Item.Content>
    <Item.Title>Profile verified</Item.Title>
    <Item.Description>Your identity check is complete.</Item.Description>
  </Item.Content>
  <Item.Actions>...</Item.Actions>
  <Item.Footer>Updated today</Item.Footer>
</Item>
```

`Item.Header` and `Item.Footer` occupy full rows. Media, content, and actions share the middle row,
and long titles or descriptions shrink without pushing actions outside the container.

## Item or Field

Use [Field](/components/field/) when the composition contains an input, checkbox, radio, select, or
validation message. Use Item for descriptive content and related actions. Item does not provide a
label relationship, validation state, or form semantics.

## Variants

`default` stays transparent, `outline` creates a bounded surface, and `muted` gives secondary
content a quiet background. `white` adds a bordered surface using `background-default`: white in light mode and dark in dark mode. Text and icons follow the active theme. White links and buttons retain hover, pressed, and keyboard-focus feedback.

```tsx
import { FolderIcon } from "@phosphor-icons/react";
import { Item, Stack } from "@zentara-co/zenos-ui";

function ItemVariantsExample() {
  return (
    <Stack gap="3" className="w-full max-w-xl">
      {(["default", "outline", "muted", "white"] as const).map((variant) => (
        <Item key={variant} variant={variant}>
          <Item.Media variant="icon">
            <FolderIcon aria-hidden="true" />
          </Item.Media>
          <Item.Content>
            <Item.Title>{variant[0].toUpperCase() + variant.slice(1)} item</Item.Title>
            <Item.Description>A reusable content row using the {variant} surface.</Item.Description>
          </Item.Content>
        </Item>
      ))}
    </Stack>
  );
}
```

White items support the same `render` composition as other variants:

```tsx
import { Item, Stack } from "@zentara-co/zenos-ui";
import { useState } from "react";

function ItemWhiteExample() {
  const [enabled, setEnabled] = useState(false);

  return (
    <Stack gap="3" className="w-full max-w-xl">
      <Item variant="white" render={<a href="#accessibility" />}>
        <Item.Content>
          <Item.Title>Accessibility guidance</Item.Title>
          <Item.Description>Read the interaction and labeling guidance.</Item.Description>
        </Item.Content>
      </Item>
      <Item
        variant="white"
        render={
          <button
            type="button"
            aria-label="Toggle weekly summary"
            aria-pressed={enabled}
            onClick={() => setEnabled(!enabled)}
          />
        }
      >
        <Item.Content>
          <Item.Title>Weekly summary</Item.Title>
          <Item.Description>{enabled ? "Enabled" : "Disabled"}</Item.Description>
        </Item.Content>
      </Item>
    </Stack>
  );
}
```

## Sizes

Use `sm`, `md`, or `lg` to coordinate the row spacing and icon or image scale. The default is `md`.

```tsx
import { FolderIcon } from "@phosphor-icons/react";
import { Item, Stack } from "@zentara-co/zenos-ui";

function ItemSizesExample() {
  return (
    <Stack gap="3" className="w-full max-w-xl">
      {(["sm", "md", "lg"] as const).map((size) => (
        <Item key={size} size={size} variant="outline">
          <Item.Media variant="icon">
            <FolderIcon aria-hidden="true" />
          </Item.Media>
          <Item.Content>
            <Item.Title>{size.toUpperCase()} item</Item.Title>
            <Item.Description>Spacing and media scale follow the item size.</Item.Description>
          </Item.Content>
        </Item>
      ))}
    </Stack>
  );
}
```

## Groups and separators

Use `Item.Group` to collect related rows and `Item.Separator` when a visible boundary helps users
scan the group.

```tsx
import { ArrowRightIcon } from "@phosphor-icons/react";
import { Item } from "@zentara-co/zenos-ui";

function ItemGroupExample() {
  const destinations = [
    ["Workspace", "Manage members, roles, and workspace details."],
    ["Notifications", "Choose which security events should reach you."],
    ["API access", "Create and rotate credentials for integrations."],
  ] as const;

  return (
    <Item.Group className="w-full max-w-xl rounded-lg border border-border-default bg-background-neutral-card">
      {destinations.map(([title, description], index) => (
        <div key={title}>
          {index > 0 ? <Item.Separator /> : null}
          <Item render={<a href={`#${title.toLowerCase().replaceAll(" ", "-")}`} />}>
            <Item.Content>
              <Item.Title>{title}</Item.Title>
              <Item.Description>{description}</Item.Description>
            </Item.Content>
            <Item.Actions aria-hidden="true">
              <ArrowRightIcon className="size-4 rtl:rotate-180" />
            </Item.Actions>
          </Item>
        </div>
      ))}
    </Item.Group>
  );
}
```

## Links and actions

Compose the root onto an anchor with `render`. The entire row then receives the hover and
focus-visible treatment.

```tsx
<Item render={<a href="/settings" />}>
  <Item.Content>
    <Item.Title>Settings</Item.Title>
    <Item.Description>Manage workspace preferences.</Item.Description>
  </Item.Content>
</Item>
```

Do not put buttons or other interactive controls inside an Item rendered as a link. For a row with
`Item.Actions`, keep the root non-interactive and give each action its own accessible control.

## Media

Use `variant="icon"` for a framed glyph and `variant="image"` for a cropped image. The default media
slot leaves its child styling untouched, which makes it suitable for Avatar, Badge, or custom media.

## RTL

Item uses logical spacing and alignment. Actions move to the logical end, and directional icons can
use `rtl:rotate-180` when their meaning should mirror.

## Variants

default, outline, muted, white

## Sizes

sm, md, lg

## Anatomy

```text
Item.Root
Item.Group
Item.Separator
Item.Header
Item.Media
Item.Content
Item.Title
Item.Description
Item.Actions
Item.Footer
```

## API

| Prop | Type | Default | Description |
| --- | --- | --- | --- |
| variant | default \| outline \| muted \| white | default | Transparent, bordered, quiet, or white surface treatment. White adapts to a dark surface in dark mode. |
| size | sm \| md \| lg | md | Coordinates row spacing and icon or image scale. |
| render | ReactElement \| ((props, state) => ReactElement) | — | Composes Item props onto another element, such as an anchor. |
| Media.variant | default \| icon \| image | default | Unstyled media, framed icon, or cropped image presentation. |
| Group / Header / Content / Title / Description / Actions / Footer | native element props | — | Composable slots with forwarded refs, classes, and native attributes. |
| Separator | HTMLAttributes<HTMLDivElement> | — | Horizontal separator with separator semantics. |
| native props | React.HTMLAttributes<HTMLDivElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |

Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props, including className, style, aria-*, and data-*.

## Accessibility

- Choose meaningful native semantics through `render`, such as an anchor for navigation.
- Give icon-only actions an accessible name.
- Do not rely on the variant or media color to communicate status.
- Keep heading hierarchy outside Item unless a title genuinely introduces a document section.
- Item Group is presentational by default; apply list semantics only when the surrounding content
  is truly a list.

The component is adapted to Zenos conventions from the [shadcn Item pattern](https://ui.shadcn.com/docs/components/base/item).

Source: https://zenos-ui.pages.dev/components/item/