datui
Color scheme

Buttons

Button

The main action control. Renders a native button, or a link when given href.

import { Button } from "datui";

Playground

<Button variant="primary" appearance="accent" size="m">Continue</Button>

Examples

Variants

variant sets visual weight, appearance sets color intent.

Sizes

Icons and loading

Accessibility

  • Renders <button type="button">; with href it renders <a>. Enter and Space activate natively.
  • Icon-only buttons have no visible text — pass aria-label.
  • loading sets aria-busy, announces loadingLabel through a status spinner and ignores clicks.
  • disabled sets the native disabled attribute; disabled links drop href and get aria-disabled.

API

Button

The main action control. Renders `<button>` by default and `<a>` when given `href`. Icon-only buttons (no children) need an `aria-label`.

PropTypeDefaultDescription
afterReactNode—Content after the label, e.g. an icon or `Counter`.
align"center" | "left" | "right"—
appearance"accent" | "negative" | "positive" | "neutral" | "overlay"—
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
beforeReactNode—Content before the label, usually an icon.
classNamestring—
disabledboolean—
hrefstring—
loadingbooleanfalseShows a spinner, blocks activation and sets `aria-busy`.
loadingLabelstringLoading…Accessible label announced while loading.
relstring—
roundedboolean—
size"s" | "m" | "l"—
stretchedboolean—
targetstring—
type"button" | "submit" | "reset"—
variant"link" | "primary" | "secondary" | "tertiary" | "outline"—