Forms & Input
All form controls in the library: text fields, selectors, choice inputs, rating, file handling, and date pickers.
Components in this category
Single-line text input with affix slots and validation state.
SearchInputText input with search icon and clear button.
PasswordInputMasked field with a reveal toggle.
PasswordStrengthDisplays a password strength estimate.
TextareaMulti-line text input with auto-resize.
NumberInputNumeric input with step controls.
SelectDropdown selector with search and multi-select support.
SelectTriggerThe trigger button for a Select, used in custom menus.
EnvSelectEnvironment selector (dev / staging / production) with color coding.
AutocompleteText input with dropdown suggestions.
CheckboxBoolean checkbox with indeterminate state.
CheckboxFieldCheckbox with a label, description and validation.
CheckboxGroupGroup of checkboxes with select-all support.
RadioRadio button, always used inside a RadioGroup.
RadioGroupMutually-exclusive radio button group.
SwitchToggle switch for boolean settings.
SliderRange slider with single or double thumbs.
SegmentedControlHorizontal button group for mutually-exclusive options.
RatingRead-only star (or custom icon) rating display.
RatingInputInteractive star rating for user input.
ColorPickerColor picker with swatch grid and custom hex input.
IconPickerIcon picker with a searchable grid, Tabler defaults and injectable custom icons.
TokenFieldMultiple-value input rendered as removable tokens.
FileUploadFile upload with drag-and-drop, progress and validation.
DropzoneDrag-and-drop target area.
FileListList of uploaded files with status and actions.
TransferListTwo-panel list for moving items between source and target.
DatePickerSingle-date calendar picker with presets.
DateRangePickerDate range calendar picker with presets.
DateRangeFieldText field for typing a date range directly.
MiniCalendarCompact calendar month view for date selection.
Text inputs
The five text-entry controls (Input, SearchInput, PasswordInput, Textarea, and NumberInput) share the same visual shell, sizing, and invalid state handling. Each accepts standard HTML attributes for its native element.
Input
Input wraps a native <input> in the shared Control shell, with optional leading and trailing icon slots.
| Prop | Type | Default | Description |
|---|---|---|---|
type | string | "text" | text, password, email, number, etc. |
placeholder | string | — | Placeholder text. |
value | string | — | Controlled value. |
onChange | React.ChangeEventHandler | — | Change handler. |
leftIcon | ReactNode | — | Leading icon slot. |
rightIcon | ReactNode | — | Trailing icon slot. |
size | "sm" | "md" | "md" | Control size. |
invalid | boolean | — | Red border and focus ring. |
disabled | boolean | — | Prevents interaction. |
readOnly | boolean | — | Read-only, focusable. |
mono | boolean | — | Monospace font. |
import { Input } from "@solarius/onset";
<Input placeholder="Email" type="email" size="md" />
<Input leftIcon={<IconSearch size={13} />} placeholder="Search…" />
<Input invalid message="This field is required" />SearchInput
SearchInput is Input with a built-in search icon and a default placeholder="Search…".
PasswordInput
PasswordInput is Input with a lock icon and a reveal toggle. The toggle is out of the tab order, so it never sits between the field and the submit button. Pair it with PasswordStrength wherever a password is being chosen rather than entered. Full page →
Textarea
Multi-line text field in the same Control shell as Input.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled value. |
onChange | React.ChangeEventHandler | — | Change handler. |
rows | number | — | Visible rows. |
placeholder | string | — | Placeholder text. |
noResize | boolean | — | Disable manual resizing. |
mono | boolean | — | Monospace font. |
invalid | boolean | — | Red border and focus ring. |
NumberInput
Numeric field with stepper buttons, arrow-key and scroll stepping, press-and-hold repeat, and a clamp on blur. Accepts optional prefix and suffix units.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | null | — | Controlled value. |
onChange | (value: number | null) => void | — | Change handler. |
min | number | — | Minimum value. |
max | number | — | Maximum value. |
step | number | 1 | Step increment. |
shiftStep | number | 10 | Step multiplier while Shift is held. |
prefix | ReactNode | — | Static text before the number (e.g. '$'). |
suffix | ReactNode | — | Static text after the number (e.g. 'ms'). |
hideStepper | boolean | — | Hide the spinner buttons. |
Selectors
Select
Select is a dropdown picker built from SelectTrigger + Popover + ContextMenu. Pick an option from a positioned list; the trigger label updates.
| Prop | Type | Default | Description |
|---|---|---|---|
options | SelectOption[] | — | Available choices. |
value | string | — | Controlled value. |
defaultValue | string | — | Initial uncontrolled value. |
onChange | (value: string) => void | — | Selection handler. |
placeholder | ReactNode | — | Shown when nothing is selected. |
size | "sm" | "md" | "md" | Control size. |
SelectTrigger
SelectTrigger is the dropdown-style button used by Select. Use it directly when pairing with a custom DropdownMenu or Popover.
EnvSelect
EnvSelect is the environment picker from the topbar: a compact button with a toned StatusDot and caret. Pass a tone ("ok", "warn", "err", "idle", "prov") and children.
Autocomplete
Free-text combobox: type to filter, ↑/↓ to move, Enter to commit. Supports grouping, remote search via onInputChange + disableFilter, and an inline "Create…" row.
| Prop | Type | Default | Description |
|---|---|---|---|
options | AutocompleteOption[] | — | Available choices. |
value | string | null | — | Currently selected value. |
onChange | (value: string | null, option: AutocompleteOption | null) => void | — | Selection handler. |
inputValue | string | — | Controlled query text (for remote search). |
onInputChange | (query: string) => void | — | Query change handler. |
filter | (option, query) => boolean | — | Custom filter function. |
disableFilter | boolean | — | Skip local filtering (server-side). |
loading | boolean | — | Shows a spinner. |
onCreate | (query: string) => void | — | Show 'Create…' row. |
Choice inputs
Checkbox
Bare check box with no label. Use it as the base for CheckboxField and CheckboxGroup. Supports indeterminate for select-all headers.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | Checked state. |
onChange | (checked: boolean) => void | — | Toggle handler. |
indeterminate | boolean | — | Renders the mixed dash, aria-checked='mixed'. |
size | "sm" | "md" | "sm" | sm for table rows, md for form rows. |
disabled | boolean | — | Prevents interaction. |
CheckboxField
Labeled form checkbox that wraps a native <input type="checkbox"> for form and keyboard semantics. Supports a dim description line.
CheckboxGroup
Multi-select checkbox list with an optional tri-state "select all" parent row.
Radio / RadioGroup
Mutually-exclusive choice. Radio must live inside a RadioGroup. Supports inline layout via inline on the group.
Switch
Toggle switch for boolean settings, rendered as a role="switch" button.
| Prop | Type | Default | Description |
|---|---|---|---|
checked | boolean | — | On/off state. |
onChange | (checked: boolean) => void | — | Toggle handler. |
disabled | boolean | — | Prevents interaction. |
Slider
Range slider with an optional numeric readout. The filled portion of the track uses the primary color.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Controlled value. |
defaultValue | number | — | Initial uncontrolled value. |
onChange | (value: number) => void | — | Change handler. |
min | number | 0 | Minimum value. |
max | number | 100 | Maximum value. |
step | number | 1 | Step increment. |
showValue | boolean | (value: number) => string | — | Show numeric readout. |
SegmentedControl
Inline mutually-exclusive picker: a tighter alternative to Tabs for toolbar contexts like time range or view mode switching.
Rating
Rating
Read-only star display with fractional fills. Renders as role="img" with an accessible label.
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Numeric rating. |
max | number | 5 | Number of symbols. |
size | number | 12 | Star size in px. |
label | ReactNode | — | Dim trailing text (e.g. '4.6 · 218 reviews'). |
color | string | var(--m-color-warn) | Star color. |
RatingInput
Interactive star input with hover preview, keyboard navigation, and optional labels text. Clicking the current value clears it (when clearable).
| Prop | Type | Default | Description |
|---|---|---|---|
value | number | — | Controlled value. |
defaultValue | number | — | Initial uncontrolled value. |
onChange | (value: number) => void | — | Change handler. |
max | number | 5 | Number of stars. |
clearable | boolean | true | Clicking current value clears it to 0. |
labels | string[] | — | Text for each level (index 0 = one star). |
Other inputs
ColorPicker
Swatch trigger that opens an HSL picker with a saturation/lightness field, hue rail, hex entry, and preset swatches. Color is stored in HSL internally but the public value is always a #rrggbb string.
| Prop | Type | Default | Description |
|---|---|---|---|
value | string | — | Controlled hex color. |
defaultValue | string | "#7366ff" | Initial uncontrolled color. |
onChange | (hex: string) => void | — | Change handler. |
swatches | string[] | DEFAULT_SWATCHES | Preset row. Pass [] to hide. |
showValue | boolean | true | Show the hex next to the swatch. |
import { ColorPicker, DEFAULT_SWATCHES } from "@solarius/onset";
<ColorPicker value="#7366ff" onChange={setColor} swatches={DEFAULT_SWATCHES} />;TokenField
Multi-value tag input: type + Enter to add, Backspace to pop, with an optional suggestion dropdown.
| Prop | Type | Default | Description |
|---|---|---|---|
values | string[] | — | Controlled values. |
defaultValues | string[] | — | Initial uncontrolled values. |
onChange | (values: string[]) => void | — | Change handler. |
suggestions | string[] | — | Dropdown suggestions as the user types. |
placeholder | string | "Add…" | Placeholder text. |
allowCustom | boolean | true | Allow values not in suggestions. |
FileUpload / Dropzone / FileList
Dropzone is the drag-and-drop + click-to-browse target. FileList renders uploaded-file rows with per-file progress and removal. FileUpload composes both. formatFileSize is exported for formatting bytes.
import {
Dropzone,
FileList,
FileUpload,
formatFileSize,
} from "@solarius/onset";
import type { UploadFile } from "@solarius/onset";TransferList
Dual-listbox assignment control: check items and move them across with arrow buttons. Commonly used for territory, role, and segment membership.
| Prop | Type | Default | Description |
|---|---|---|---|
items | TransferItem[] | — | All available items. |
targetIds | string[] | — | Ids currently on the right (assigned) side. |
onChange | (targetIds: string[]) => void | — | Assignment change handler. |
titles | [ReactNode, ReactNode] | ["Available", "Assigned"] | Column titles. |
searchable | boolean | true | Show search boxes above each list. |
listHeight | number | 168 | List body height in px. |
File handling
Specimen examples for Dropzone, FileList, and FileUpload.
Date & time
DatePicker
Input-bound single-date picker: MiniCalendar in a popover, plus a text field you can type into. Supports presets for quick selection rows.
| Prop | Type | Default | Description |
|---|---|---|---|
value | Date | null | — | Controlled date. |
defaultValue | Date | null | — | Initial uncontrolled date. |
onChange | (date: Date | null) => void | — | Selection handler. |
min | Date | — | Earliest selectable date. |
max | Date | — | Latest selectable date. |
presets | { label, date }[] | DEFAULT_DATE_PRESETS | Quick rows above the calendar. |
placeholder | string | "Pick a date" | Placeholder text. |
clearable | boolean | true | Show a clear button. |
import { DatePicker, DEFAULT_DATE_PRESETS } from "@solarius/onset";DateRangePicker
Preset-driven analytics range selector with a two-month MiniCalendar grid. Unlike DateRangeField, this is always populated; use it when a date range is required context (a dashboard, a report).
DateRangeField
Two-date variant bound to a single field: click to pick a start, click again for the end. Reads as a form control and can be empty. Use formatDateRange to display a DateRange in text.
MiniCalendar
Compact month grid, standalone in a card or as the calendar half of the date pickers. Supports single-date selection or range highlighting via rangeStart/rangeEnd.