datui
Color scheme

Forms

SelectMimicry

Looks like a select but is a button that opens something else, e.g. a modal picker.

import { SelectMimicry } from "datui";

Playground

<SelectMimicry placeholder="Choose…" selectType="default" />

Examples

Opening a picker

Accessibility

  • A native <button> with aria-haspopup (default dialog); Enter and Space activate.
  • Shows placeholder while children is empty.

API

SelectMimicry

Looks like a select but is a button that opens something else (a modal, a picker page). `ref` points at the button.

PropTypeDefaultDescription
afterReactNode<DropdownIcon />Trailing content.
alignTextAlignleft
aria-haspopupboolean | "true" | "false" | "dialog" | "menu" | "grid" | "listbox" | "tree"dialogWhat the button opens, for `aria-haspopup`.
beforeReactNode—Content before the control, usually an icon.
classNamestring—
multilinebooleanfalseWrap long values instead of truncating.
placeholderstring—Shown while `children` (the current value) is empty.
selectTypeSelectTypedefault
statusFormFieldStatus"default"Visual validation state. Pair `error` with `aria-invalid` on the control (FormItem does this).