codefast/ui

Command Palette

Search for a command to run...

Display

Item

Row layout for lists. Composes media, content, title, description, and action slots.

Install

pnpm add @codefast/ui

Import path

@codefast/ui/item

Examples

Avatar

You can use ItemMedia with variant='avatar' to display an avatar.

AS
Ava Stone

Last seen 5 months ago

AS
No Team Members

Invite your team to collaborate on this project.

Dropdown

A versatile component for displaying content with media, title, description, and actions.

Group

Use ItemGroup to group related items together.

c
codefast

hello@codefastlabs.com

l
leo

leo@codefastlabs.com

a
ava

ava@codefastlabs.com

Header

Use ItemHeader to add a header above the item content.

v0-1.5-sm
v0-1.5-sm

Everyday tasks and UI generation.

v0-1.5-lg
v0-1.5-lg

Advanced thinking or reasoning.

v0-2.0-mini
v0-2.0-mini

Open Source model for everyone.

Icon

Use ItemMedia with variant='icon' to display an icon.

Security Alert

New login detected from unknown device.

RTL

Right-to-left layout support for languages such as Arabic and Hebrew.

Translations are AI-generated for demonstration and may be imperfect.

عنصر أساسي

عنصر بسيط يحتوي على عنوان ووصف.

تم التحقق من ملفك الشخصي.

Size

Use the size prop to change the size of the item.

Default Size

The standard size for most use cases.

Small Size

A compact size for dense layouts.

Extra Small Size

The most compact size available.

Variant

Use the variant prop to change the visual style of the item.

Default Variant

Transparent background with no border.

Outline Variant

Outlined style with a visible border.

Muted Variant

Muted background for secondary content.

Anatomy

How the parts compose. Copy this skeleton and fill in the slots.

import {
  ItemGroup, Item, ItemMedia, ItemContent,
  ItemTitle, ItemDescription, ItemActions,
} from "@codefast/ui/item";

<ItemGroup>
  <Item>
    <ItemMedia>…</ItemMedia>
    <ItemContent>
      <ItemTitle>…</ItemTitle>
      <ItemDescription>…</ItemDescription>
    </ItemContent>
    <ItemActions>…</ItemActions>
  </Item>
</ItemGroup>

API reference

Props for each part of the component. All native element props are also forwarded.

Item / ItemGroup

A row layout and the container that stacks rows.

PropTypeDefaultDescription
childrenReactNodeCompose ItemMedia, ItemContent, and ItemActions inside an Item.

ItemMedia / ItemContent / ItemTitle / ItemDescription / ItemActions

PropTypeDefaultDescription
childrenReactNodeLeading media, the title + description block, and trailing actions.

Accessibility

Built to be keyboard-navigable and screen-reader friendly out of the box.

  • Item is presentational — give actions real buttons/links with labels.
  • Use ItemSeparator between rows; it’s decorative for assistive tech.
  • If a whole row is clickable, wrap it in one link rather than nesting interactives.

Guidelines

Conventions that keep usage consistent across an app.

Do

  • Use for settings lists, inboxes, and search results.
  • Keep one primary action per row.

Don’t

  • Don’t nest multiple competing actions in a row.
  • Don’t use Item where a Table’s columns fit better.