Data display
SimpleCell
Base list row with before/after slots, title, subtitles, indicator and chevron. Becomes a button with onClick or a link with href.
import { SimpleCell } from "datui";Playground
Notifications Sounds, badges On
<SimpleCell subtitle="Sounds, badges" indicator="On" chevron chevronSize="m">Notifications</SimpleCell>Examples
Slots
Every slot is optional; text truncates unless multiline.
Multiline row with a long title that wraps instead of truncating This subtitle wraps onto several lines instead of being cut with an ellipsis.
Navigation rows
chevron and indicator for settings-style lists.
Accessibility
- Renders
<button type="button">withonClick,<a>withhref, otherwise a plain<div>. - Title, subtitle and indicator are separated by spaces so the accessible name reads naturally.
- The chevron is decorative (
aria-hidden) and mirrors in right-to-left layouts. - Truncated text keeps its full content in the DOM, so screen readers read all of it.
- Don't put buttons or links inside an interactive SimpleCell; use
Cellmodes orRichCellactions instead.
API
SimpleCell
Base list row: before slot, title with badges, subtitle lines, indicator, after slot and chevron. Renders a `button` with `onClick`, an `a` with `href`, otherwise a `div`.
| 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. |
| 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. |
| chevron | boolean | false | Show a trailing chevron for navigational rows. |
| chevronSize | "s" | "m" | m | |
| className | string | — | |
| disabled | boolean | — | |
| extraSubtitle | ReactNode | — | |
| hasActive | boolean | true | Background tint while pressed. |
| hasHover | boolean | true | Background tint on hover. |
| 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" | — |