Skip to main content

Forms and controls

Form components render native elements, then layer the Silva visual system on top. Pair labels with matching id values for accessible controls.

Field composition

Form is a vertical form wrapper. Field groups a control with error or helperText; its FieldError and FieldHelper exports are available for custom layouts.

Inputs

Input, TextArea, and Label support sm, md and lg sizes. Inputs expose the standard native fields such as name, value, defaultValue, disabled, required, and onChange.

Select

Select accepts native <option> children and provides an accessible trigger, keyboard navigation, and a listbox of choices.

Choice controls

Switch

Switch is a labelled native checkbox with role="switch". Use checked for controlled state or defaultChecked for an initial value.

Slider

Slider renders a native range input with min, max, step, value, and defaultValue support.

Toggle group

ToggleGroup groups related toggle buttons. Apply data-active from your application state to the selected ToggleGroupItem.

Buttons

Button supports xs through xl sizes and solid, outline, ghost, and link variants.