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>witharia-haspopup(defaultdialog); Enter and Space activate. - Shows
placeholderwhilechildrenis 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.
| Prop | Type | Default | Description |
|---|---|---|---|
| after | ReactNode | <DropdownIcon /> | Trailing content. |
| align | TextAlign | left | |
| aria-haspopup | boolean | "true" | "false" | "dialog" | "menu" | "grid" | "listbox" | "tree" | dialog | What the button opens, for `aria-haspopup`. |
| before | ReactNode | — | Content before the control, usually an icon. |
| className | string | — | |
| multiline | boolean | false | Wrap long values instead of truncating. |
| placeholder | string | — | Shown while `children` (the current value) is empty. |
| selectType | SelectType | default | |
| status | FormFieldStatus | "default" | Visual validation state. Pair `error` with `aria-invalid` on the control (FormItem does this). |