datui
Color scheme

Primitives

Tappable & Clickable

Clickable renders the right interactive element for its props; Tappable adds hover, press, focus and disabled feedback. Buttons, cells and tabs are built on them.

import { Tappable, Clickable } from "datui";

Examples

Feedback modes

Non-native elements

A div with onClick gets role="button", a tab stop and Enter/Space activation.

Focus me and press Enter or Space
Activated 0 times

Accessibility

  • With href renders <a>, with onClick renders <button type="button">; otherwise a non-interactive div.
  • Non-native elements (as="div") receive role="button", tabIndex=0 and Enter/Space activation.
  • disabled uses the native attribute on buttons and aria-disabled elsewhere; links lose their href.
  • Focus is shown with the shared focus ring on keyboard focus only (:focus-visible).

API

Tappable

Interactive surface with consistent hover, press, focus and disabled feedback. Base of buttons, cells and tabs.

PropTypeDefaultDescription
activatedboolean—Keep the pressed look, e.g. for the active item of a list.
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
classNamestring—
disabledboolean—
feedback"background" | "opacity" | "none"—Feedback on hover/press. `background` tints the surface; `opacity` fades it.
hrefstring—
relstring—
targetstring—
type"button" | "submit" | "reset"—

Clickable

Renders the right interactive element for its props and gives non-native elements button semantics (role, tab stop, Enter/Space activation).

PropTypeDefaultDescription
asElementType<any, keyof IntrinsicElements>—Element to render. Defaults to `a` with `href`, `button` with `onClick`, otherwise `div`.
classNamestring—
disabledboolean—
hrefstring—
relstring—
targetstring—
type"button" | "submit" | "reset"—