datui
Color scheme

Buttons

ToolButton

Toolbar button with a density-adaptive icon and optional text.

import { ToolButton } from "datui";

Playground

<ToolButton variant="primary" appearance="accent" direction="row">Edit</ToolButton>

Examples

Variants and direction

Accessibility

  • Renders <button> (or <a> with href); Enter/Space activate natively.
  • Icon-only buttons need aria-label; icons are aria-hidden.
  • Icons switch size (or iconCompact/iconRegular) with AppRoot density via CSS.

API

ToolButton

Toolbar button with a density-adaptive icon and optional text. Icon-only needs `aria-label`.

PropTypeDefaultDescription
activatedboolean—Keep the pressed look, e.g. for the active item of a list.
appearance"accent" | "neutral"accent
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
classNamestring—
direction"row" | "column"rowIcon beside (`row`) or above (`column`) the text.
disabledboolean—
hrefstring—
iconReactNode—Icon; sized 24px at regular density and 20px at compact.
iconCompactReactNode—Explicit icon for compact density (with `iconRegular`).
iconRegularReactNode—Explicit icon for regular density (with `iconCompact`).
relstring—
roundedboolean—Pill shape. Ignored for `column` buttons with text.
targetstring—
type"button" | "submit" | "reset"—
variant"primary" | "secondary" | "tertiary" | "outline"primary