Buttons
CellButton
Full-width list-row button with the cell layout. CellButtonGroup stacks several into one rounded block.
import { CellButton, CellButtonGroup, CellButtonGroupSeparator } from "datui";Playground
<CellButton appearance="accent">Add member</CellButton>Examples
Appearances
accent, neutral and negative; centered for lone actions.
Group
CellButtonGroup.Separator draws an inset line between rows.
Accessibility
- Always a
<button type="button">(or<a>withhref); Enter and Space activate natively. - Title and subtitles are separated by spaces, so the accessible name reads "Add member Up to 10 people".
disabledsets the native attribute. The chevron isaria-hidden.- Give
CellButtonGrouprole="group"and anaria-labelwhen the set of actions needs a name. Separators are decorative.
API
CellButton
Full-width list-row button. Renders `<button>`, or `<a>` with `href`.
| Prop | Type | Default | Description |
|---|---|---|---|
| activated | boolean | — | Keep the pressed look, e.g. for the active item of a list. |
| after | ReactNode | — | Trailing content, e.g. a switch, counter or button-free text. |
| appearance | "accent" | "negative" | "neutral" | accent | Color of the title and icons. |
| as | ElementType<any, keyof IntrinsicElements> | — | Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`. |
| badgeAfterSubtitle | ReactNode | — | |
| badgeAfterTitle | ReactNode | — | |
| badgeBeforeSubtitle | ReactNode | — | |
| badgeBeforeTitle | ReactNode | — | |
| before | ReactNode | — | Leading content, e.g. an icon or avatar. |
| centered | boolean | false | Center the content, e.g. for a lone "Log out" row. |
| chevron | boolean | false | Show a trailing chevron for navigational rows. |
| chevronSize | "s" | "m" | "m" | |
| className | string | — | |
| disabled | boolean | — | |
| extraSubtitle | ReactNode | — | |
| href | string | — | |
| indicator | ReactNode | — | Secondary value shown before `after`, e.g. the current setting. |
| multiline | boolean | false | Wrap long text instead of truncating it. |
| overTitle | ReactNode | — | Small text above the title. |
| rel | string | — | |
| subtitle | ReactNode | — | |
| target | string | — | |
| type | "button" | "submit" | "reset" | — |
CellButtonGroup
Stacks CellButtons into one rounded block. Pass `role="group"` and `aria-label` when the group needs a name.
| Prop | Type | Default | Description |
|---|---|---|---|
| className | string | — |
CellButtonGroupSeparator
Inset horizontal line between CellButtons in a group.
| Prop | Type | Default | Description |
|---|---|---|---|
| appearance | "primary" | "secondary" | "alpha" | — | `primary` is a solid line, `secondary` is lighter, `alpha` is translucent for colored surfaces. |
| className | string | — | |
| decorative | boolean | true | Purely visual (default) or a semantic `role="separator"`. |
| size | string | number | — | Space the separator occupies across its line; the line is centered in it. |