Skip to content

Forms

The forms components of @arbol-ai/ui: Checkbox, Combo box, Field, Form, Form save bar, Number field, Radio group, Search field, Segmented control, Select, Slider, Switch, TanStack Form, Text field.

  • Checkbox: A yes-or-no choice saved with a form, and CheckboxGroup for several options that make one list. Use Switch for settings that apply at once.
  • Combo box: A choice from a long list, found by typing. It filters as the person types and says when nothing matches; the value is the chosen option id.
  • Field: The parts every field is made of: Label, Description, FieldError and FieldHelp (the description, replaced by the error while invalid). Field wraps a control that is not a React Aria field with them, and nativeFieldBox styles a native select or text area like the rest; FieldGroup holds an input and the buttons that act on it in one box.
  • Form: Stacks fields with even spacing and leaves validation to the app: fields show its messages, never the browser bubbles. validationErrors shows a server answer under each field; FormError says why the whole form was not saved.
  • Form save bar: The SaveBar of a TanStack form (from the form entry): it shows while the values differ from the saved ones, is pending while the form saves, says why a save was refused, and Discard resets the form.
  • Number field: A number typed or stepped, formatted and parsed in the locale. Use formatOptions for currency, percentages and units.
  • Radio group: One choice among a few options, all in view. Radio for short options, RadioCard for options that need a sentence of explanation.
  • Search field: A search box with a clear button; Escape clears it. debounceMs waits for a pause in typing before searching, and clearing searches at once.
  • Segmented control: One of 2–4 mutually exclusive options side by side, as a radio group: arrow keys move the choice and the thumb slides to it. Use Tabs to switch what a page shows.
  • Select: A choice from a list that opens from a trigger. The value is the chosen option id; selectionMode=“multiple” takes several. Use ComboBox when the list is long enough to search.
  • Slider: A value picked by dragging along a track, with its formatted value beside the label. Two values make a range whose thumbs never cross.
  • Switch: An on/off setting that applies at once, with an optional label and description. Use Checkbox for a choice saved with a form.
  • TanStack Form: The fields bound to TanStack Form (from the form entry): declare the form once with useAppForm, and each field is one line that shows its value and its first error once touched. SubmitButton is pending while the form saves; FormError says why a submission was refused.
  • Text field: A labelled text box with its help and error message, in one line. Use multiline for notes; Input and TextArea are the boxes alone, for compositions of your own.

Type to search…

↑↓ navigate↵ selectEsc close