Roadie provides a set of composable form components that handle accessibility, validation states, and styling automatically. This page covers the patterns and best practices for assembling them into forms.
| Component | Purpose |
|---|---|
| Fieldset | Groups related fields with a legend |
| Field | Wraps a single input with label, helper text, and error text |
| Input | Single-line text input |
| Textarea | Multi-line text input |
| Select | Dropdown for choosing from a list |
| Combobox | Searchable dropdown with filtering |
| Autocomplete | Text input with type-ahead suggestions |
| RadioGroup | Radio buttons for selecting one option |
| Checkbox | A single opt-in, or a group for picking any number of options |
| Label | Standalone styled label |
Field, Select, and RadioGroup all use React context to flow state to their
children. Set invalid, required, and disabled on the root. Child inputs
pick up the corresponding aria attributes automatically.
Use showIndicator on any label component (Field.Label, Select.Label,
RadioGroup.Label) to automatically render a required or optional indicator
based on the parent's required prop. This eliminates the need to manually
import and place RequiredIndicator or OptionalIndicator.
Field wraps any form control, not just Input and Textarea. Use it with Select,
RadioGroup, Combobox, and Autocomplete for consistent layout, labels, and error
handling. Field provides grid gap-1.5 spacing, label wiring, and
invalid/required/disabled context that child controls inherit automatically.
Use Select.Content instead of manually nesting Portal, Positioner, and Popup.
Pass string children to Select.Item for automatic ItemText and
ItemIndicator wrapping. The individual primitives remain available for
advanced customisation.
Field.ErrorText only renders when the parent Field has invalid set.
Select.ErrorText and RadioGroup.ErrorText hide when invalid is explicitly
false. This means you can always include the error text in your markup without
conditional wrappers. Word the message with
Interface copy.
Use Fieldset with Fieldset.Legend to group related fields. This provides
semantic HTML grouping and a visible legend for screen readers.
Set invalid on the Field root to show error states across any control.
Field.ErrorText auto-hides when invalid is falsy.
Field for consistent layout, labels, and error handling.invalid, required, and disabled on the Field root. Child controls inherit these automatically.Field.Label with showIndicator for all form control labels.Field.ErrorText and Field.HelperText for feedback text.Select.Content for standard dropdowns.Fieldset with Fieldset.Legend to group related fields.aria-invalid manually. Field context handles it.RequiredIndicator or OptionalIndicator directly when using showIndicator.<div className='grid gap-1.5'> wrappers. Field provides spacing.Select.Portal + Select.Positioner + Select.Popup when Select.Content suffices.Field.ErrorText in conditional rendering ({error && ...}). The component handles visibility.intent on form components. Intent flows via the CSS cascade.