datui
Color scheme

Forms

Removable

Wraps a row or field with a remove action: a trailing ✕ button, or a two-step reveal that shows a destructive Remove button.

import { Removable } from "datui";

Playground

+1 555 0100
<Removable variant="button" align="center">+1 555 0100</Removable>

Examples

Button

Removes in one click. indent keeps the space for alignment.

anna@example.com
ben@example.com
owner@example.com (can't be removed)

Reveal

The minus button reveals a labelled Remove button; Escape, clicking elsewhere or moving focus collapses it.

Milk
Bread
Coffee

Accessibility

  • The ✕ and minus buttons are labelled with removeLabel ("Remove"); the revealed button shows it as visible text.
  • In reveal, the minus button has aria-expanded; activating it moves focus to the Remove button. Escape collapses and returns focus to the minus button.
  • While collapsed, the Remove button is inert — out of the tab order and hidden from assistive tech.
  • The remove click doesn't bubble to a surrounding row, so the row's own action never fires.

API

Removable

Wraps a row or field with a remove action.

PropTypeDefaultDescription
align"center" | "start"centerVertical alignment of the remove control.
classNamestring—
disabledboolean—
indentbooleanfalseKeep the control's space but hide it, to line up with removable siblings.
noPaddingbooleanfalseDrop the gutter around the remove control.
onRemove((event: MouseEvent<HTMLButtonElement, MouseEvent>, rootEl: HTMLDivElement | null) => void)—Called with the click event and the root element when the user confirms removal.
removeLabelstringRemoveLabel of the remove button (aria-label for `button`, visible text for `reveal`).
variant"button" | "reveal"button`button`: trailing ✕ removes at once. `reveal`: leading minus reveals a destructive "Remove" button (two steps).