Skip to content
GitHub (opens in a new tab)

Cell

Inline cell content for datasets: text, link, avatar, file, payment, badge, trend, avatar group, select, progress, rating, or row actions, with optional checkbox.

stableMoleculecontracts/cell.json

Preview

Cell

Inline dataset cell. Compose kit Avatar, Badge, Checkbox, Select, Button, and ButtonGroup. DataTable renders Cell in each td.

Master

A medium text cell with an avatar and a name. Variants shows the other types.

Maya Chen

Usage

Compose kit Avatar, Badge, and Checkbox. DataTable uses Cell in every td. Do not invent a local cell, Tag, Trend, or FileIcon.

Do's

  • DataTable body cells
  • Mixed visual and label content in a row
  • A money or metric change in a row — type trendPositive or trendNegative renders a kit Delta

Don'ts

  • A full searchable dataset — use DataTable, which composes Cell
  • A short static text table — use Table
  • Editable in-place cells — use DataGrid
<Cell
  type="text"
  size="md"
  text
  label="Maya Chen"
/>

When to use

  • DataTable body cells
  • Mixed visual and label content in a row
  • A money or metric change in a row — type trendPositive or trendNegative renders a kit Delta

When not to use

  • A full searchable dataset — use DataTable, which composes Cell
  • A short static text table — use Table
  • Editable in-place cells — use DataGrid

What an agent reads

import { Cell } from "agentic-ds-kit";
must
  • type=text is text (or text plus checkbox)
  • Avatar and AvatarGroup keep their own a11y
  • File and payment icons are aria-hidden; if text=false set aria-label on the cell from label or name
  • Trend aria-label is Up {value} or Down {value} when text is false
  • When checkbox, unlabeled kit Checkbox with ariaLabel Select ${label || name || "row"}
  • type=select uses kit Select with ariaLabel from label
  • type=progress composes kit Progress
  • type=rating is role=img, '{n} of 5'
  • type=actionIcons each icon-only Button needs ariaLabel
  • type=actionMenu ariaLabel is Row actions unless label is set. Name the menu after the row, e.g. label="Actions for INV-1842"; the open menu takes the same name. The menu uses sm rows when the Cell is sm
  • type=link is a real <a href> (or linkAs) named by label, keyboard-focusable; its click does not bubble to a row click handler
defaults
  • type text
  • size md
  • text true
  • checkbox false
  • tone neutral
stops if
  • Do not invent DataTableCell, a local Tag, Trend, FileIcon, PaymentMethod, or a second Badge — status stays Badge; user labels use kit Tag
  • Do not use raw hex
  • Do not use Badge for trends or money changes — they render through kit Delta
  • Do not invent local Avatar, AvatarGroup, Badge, or Checkbox — compose the kit pieces
  • Do not render a separate Lucide icon beside it — pass a Lucide name or component to the icon props
  • Do not invent a local progress bar — type=progress composes kit Progress. Do not invent Rating, StarRating, ActionCell
  • Do not invent a local DropdownMenu — type=actionMenu composes kit DropdownMenu
  • Do not invent local Select, Button, or ButtonGroup — compose the kit pieces
  • Do not put a Button or onClick span in a cell for navigation — type=link

From contracts/cell.json: must is the a11y requirements, defaults the prop defaults, stops if the doNot rules where the agent asks instead of inventing a cousin.

Props

NameTypeRequiredDefaultNotes
typeenumNotexttrendPositive and trendNegative render a kit Delta (direction up or down, value from label or value, default success or danger tone); put the sign in the value, e.g. +$600 or −$90. With text false they show the arrow only and the cell aria-label says Up or Down and the value. text | link | avatar | file | payment | badge | badges | trendPositive | trendNegative | avatarGroup | select | progress | rating | actions | actionIcons | actionMenu
sizesm | mdNomdAvatar, AvatarGroup, Badge and Delta map sm/md (Avatar sm 24, md 32). Checkbox is always sm.
textbooleanNotrueWhen false, hide the label (visual-only). type=text with text=false and no checkbox is an empty slot.
checkboxbooleanNofalseLeading unlabeled kit Checkbox. ariaLabel is Select ${label || name || "row"}.
labelstringNo—Text shown when text is true. For type=text this is the content.
namestringNo—Avatar / AvatarGroup person name; required for those types; falls back to label.
srcstringNo——
initialsstringNo——
avatarToneenumNo—type avatar only: passed to Avatar tone (the fallback tint for initials). Left out, the tint is picked from the name. neutral | info | success | warning | accent
peoplearrayNo—Required for avatarGroup. Passed to kit AvatarGroup, max default 3.
iconKitIconNo—file default File, payment default CreditCard. A curated Lucide name (PascalCase or kebab-case) renders instantly; any other Lucide name needs import "agentic-ds-kit/icons-on-demand" once (otherwise it is skipped with a dev warning). Or pass the Lucide component (Plus) or an element.
toneenumNoneutralSingle Badge. Demos use success for Active-like, else neutral. neutral | primary | brand | success | warning | danger | info | highlight
badgesarrayNo—type=badges. Cap at 3 kit Badges.
valuestring | numberNo—Trend number, progress 0-100, rating 0-5, or select value.
checkedbooleanNo—only when checkbox
defaultCheckedbooleanNo—only when checkbox
onCheckedChangefunctionNo—(checked: boolean) => void — only when checkbox
idstringNo—checkbox id; useId if omitted
hrefstringNo—type=link destination; label is the link text. Without href or label it renders as text.
linkAsKitLinkComponentNo—type=link: router link to render instead of <a>, e.g. Next.js Link. Receives href, className, onClick, children
optionsarrayNo—Required for type=select. Passed to kit Select.
actionsarrayNo—type=actions (labeled Buttons in ButtonGroup, cap 3), actionIcons (icon-only Buttons, each ariaLabel), actionMenu composes kit DropdownMenu from actions.
  • Component
    →

    DataTable

    Framed dataset with search, filters, column settings, and a caption title.

  • Component
    →

    Table

    Simple semantic table for invoices, lists, and text rows, with optional sort, row menu, sticky header, loading, empty and error states, row dividers on or off, and one optional highlighted row.

  • Component
    →

    DataGrid

    An editable table: people click a cell to add or change its content, like rule conditions, line items, or mappings.

  • Component
    →

    AvatarGroup

    Overlapping row of kit Avatars with an optional leftover count.