inputscss

Form

Styling for native form controls: inputs, selects, textareas, radios, checkboxes, ranges, toggle switches, labels, icons, sizes, and selectable card/field layouts.

CSS Variables

VariableDefaultScopeDescription
--z-form-checkbox-image · hook.z-checkbox:checkedBackground image drawn for a checked checkbox (the check mark).
--z-form-checkbox-image-indeterminate · hook.z-checkbox:indeterminateBackground image drawn for an indeterminate checkbox (the dash).
--z-form-danger-ring-colorvar(--z-danger).z-form-danger:focusFocus ring color for fields marked .z-form-danger.
--z-form-danger-ring-color-o100%.z-form-danger:focusOpacity applied to the danger focus ring color.
--z-form-focus-ring-colorvar(--z-focus).z-input:focus, .z-select:focus, .z-textarea:focus, .z-input-fake:focusFocus ring color for inputs, selects, textareas, and fake inputs.
--z-form-focus-ring-color-o100%.z-input:focus, .z-select:focus, .z-textarea:focus, .z-input-fake:focusOpacity applied to the focus ring color.
--z-form-icon-width2.5rem.z-form-icon, .z-inputWidth reserved for a leading or trailing form icon; the input pads itself by this amount.
--z-form-input-bgtransparent.z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardBackground color of inputs, selects, textareas, fake inputs, and radio cards.
--z-form-input-border-colorvar(--z-input).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardBorder color of the shared input base.
--z-form-input-border-color-ovar(--z-input-o).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardOpacity applied to the input border color.
--z-form-input-colorvar(--z-bg-f).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardText color of the shared input base.
--z-form-input-color-o100%.z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardOpacity applied to the input text color.
--z-form-input-font-sizevar(--z-global-font-size-small).z-form-xsmallFont size of controls; overridden by the small and extra-small size variants.
--z-form-input-heightcalc(var(--z-global-font-size) * var(--z-interactive-height-multiplier)).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardComputed control height from the global font size and the interactive height multiplier.
--z-form-input-line-heightvar(--z-global-line-height-small).z-form-xsmallLine height of controls; overridden by the small and extra-small size variants.
--z-form-input-paddingvar(--z-form-input-padding-block) var(--z-form-input-padding-inline).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardShorthand padding of the shared input base, composed from the block and inline padding variables.
--z-form-input-padding-blockcalc( var(--z-global-font-size) * var(--z-interactive-padding-block-multiplier) ).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardBlock (vertical) padding of controls, derived from the interactive padding multiplier.
--z-form-input-padding-inlinecalc( var(--z-global-font-size) * var(--z-interactive-padding-inline-multiplier) ).z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardInline (horizontal) padding of controls, derived from the interactive padding multiplier.
--z-form-input-radius · hook.z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardCorner radius of the shared input base; supplied by the theme.
--z-form-input-shadow · hook.z-input, .z-select, .z-textarea, .z-input-fake, .z-radio-cardBox shadow of the shared input base; supplied by the theme.
--z-form-radio-border-colorvar(--z-input).z-radio, .z-checkboxBorder color of radios and checkboxes.
--z-form-radio-border-color-ovar(--z-input-o).z-radio, .z-checkboxOpacity applied to the radio/checkbox border color.
--z-form-radio-focus-ring-colorvar(--z-form-radio-checked-border-color).z-radio:focus, .z-checkbox:focusFocus ring color for radios and checkboxes; defaults to the checked border color.
--z-form-radio-focus-ring-color-o30%.z-radio:focus, .z-checkbox:focusOpacity applied to the radio/checkbox focus ring color.
--z-form-radio-image · hook.z-radio:checkedBackground image drawn for a checked radio (the dot).
--z-form-radio-indeterminate-bgvar(--z-muted).z-checkbox:indeterminateBackground color of an indeterminate checkbox.
--z-form-radio-indeterminate-bg-o8%.z-checkbox:indeterminateOpacity applied to the indeterminate background color.
--z-form-radio-indeterminate-border-colorvar(--z-muted).z-checkbox:indeterminateBorder color of an indeterminate checkbox.
--z-form-radio-indeterminate-border-color-o32%.z-checkbox:indeterminateOpacity applied to the indeterminate border color.
--z-form-radio-radius · hook.z-radio, .z-checkboxCorner radius of radios and checkboxes; supplied by the theme (radios override it to a circle).
--z-form-radio-shadow · hook.z-radio, .z-checkboxBox shadow of radios and checkboxes; supplied by the theme.
--z-form-toggle-switch-shadow · hook.z-toggle-switchBox shadow of the toggle switch; supplied by the theme.
--z-radio-card-checked-border-colorvar(--z-bg-f).z-radio-cardBorder color token for a checked radio card, overridden by .z-form-danger; currently declared but not consumed by any rule.
--z-radio-card-gap0.5rem.z-radio-cardGap between a radio card's control and its text column.
--z-range-thumb-bgvar(--z-bg).z-rangeBackground color of the range thumb.
--z-range-thumb-bg-o100%.z-rangeOpacity applied to the range thumb color.
--z-range-thumb-border-colorvar(--z-primary).z-rangeBorder color of the range thumb.
--z-range-thumb-border-color-o50%.z-rangeOpacity applied to the range thumb border color.
--z-range-thumb-margin-top-7px.z-rangeVertical offset that centers the range thumb on the track.
--z-range-thumb-radius500px.z-rangeCorner radius of the range thumb.
--z-range-thumb-size1rem.z-rangeHeight and width of the range thumb.
--z-range-track-bgvar(--z-primary).z-rangeBackground color of the range track.
--z-range-track-bg-o20%.z-rangeOpacity applied to the range track color.
--z-range-track-height3px.z-rangeHeight of the range track.
--z-range-track-radius500px.z-rangeCorner radius of the range track.
--z-toggle-field-gap1rem.z-toggle-fieldGap between a toggle field's text and its switch.
--z-toggle-switch-bgvar(--z-input).z-toggle-switchBackground color of the unchecked toggle switch track.
--z-toggle-switch-bg-ovar(--z-input-o).z-toggle-switchOpacity applied to the toggle switch track color.
--z-toggle-switch-height1.25rem.z-toggle-switchHeight of the toggle switch track.
--z-toggle-switch-knob-bgvar(--z-bg).z-toggle-switchBackground color of the toggle switch knob.
--z-toggle-switch-knob-bg-o100%.z-toggle-switchOpacity applied to the toggle switch knob color.
--z-toggle-switch-width2.25rem.z-toggle-switchWidth of the toggle switch track.

CSS Classes

ClassRoleApplies toDescription
.z-checkboxelement.z-inputNative checkbox styled as a custom square; the check and indeterminate marks come from background images.
.z-fieldsetelement.z-inputFieldset wrapper with min-width: 0 so it can shrink inside flex/grid layouts.
.z-form-blankelement.z-inputRemoves an input's background, border, and shadow, and suppresses the focus outline.
.z-form-customelement.z-inputWrapper that overlays a native <select> or file <input> transparently on top of custom-styled content.
.z-form-dangermodifier.z-inputMarks a field invalid: switches the focus ring (and radio-card border) to the danger color.
.z-form-helpelement.z-inputSmall helper text below a field.
.z-form-iconmodifier.z-inputIcon positioned inside an input's leading edge; the input pads itself to make room.
.z-form-icon-flipelement.z-inputMoves the form icon to the trailing edge of the input.
.z-form-labelelement.z-inputField label typography.
.z-form-label-requiredelement.z-inputAppends a danger-colored asterisk to a required field's label.
.z-form-largemodifier.z-inputLarge control size: taller height and larger padding.
.z-form-mediummodifier.z-inputMedium (default) control size.
.z-form-smallmodifier.z-inputSmall control size with smaller font and line height.
.z-form-stackedelement.z-inputStacks labels above their fields by making .z-form-label block-level.
.z-form-xsmallmodifier.z-inputExtra-small control size with smaller font and line height.
.z-inlineelement.z-inputInline-block wrapper that keeps an input and its icon aligned on one line.
.z-inputroot.z-inputRoot class for native text inputs; also the shared base style for selects, textareas, fake inputs, and radio cards.
.z-input-fakeelement.z-inputNon-input element styled to look like an input, such as a custom select trigger.
.z-radioelement.z-inputNative radio styled as a custom circle; the checked dot comes from a background image.
.z-radio-cardmodifier.z-inputSelectable card wrapping a radio/checkbox with a label and description; highlights its border when checked.
.z-radio-card-bodyelement.z-inputText column of a radio card, holding the label and description.
.z-radio-card-controlelement.z-inputLeading column of a radio card that holds and vertically centers the radio/checkbox.
.z-radio-card-descriptionelement.z-inputMuted description text inside a radio card.
.z-radio-card-labelelement.z-inputLabel text inside a radio card.
.z-rangeelement.z-inputNative range slider with a custom track and thumb.
.z-selectelement.z-inputNative <select> styled to match inputs; single selects drop the native arrow, while multiple/size selects grow and resize vertically.
.z-textareaelement.z-inputNative textarea styled to match inputs, with a two-line minimum height.
.z-toggle-fieldelement.z-inputRow pairing a label/description with a toggle switch, spaced apart and clickable as a whole.
.z-toggle-field-bodyelement.z-inputText column of a toggle field, holding the label and description.
.z-toggle-field-controlelement.z-inputTrailing column of a toggle field that holds and centers the switch.
.z-toggle-field-descriptionelement.z-inputMuted description text inside a toggle field.
.z-toggle-field-labelelement.z-inputLabel text inside a toggle field.
.z-toggle-switchelement.z-inputCheckbox styled as a sliding toggle switch.
.z-toggle-switch-dangerelement.z-inputColors the checked toggle switch with the danger color.
.z-toggle-switch-primaryelement.z-inputColors the checked toggle switch with the primary color.

Accessibility

  • Radio cards and toggle fields wrap their native control in a clickable row, so the label activates the control; a disabled control dims the whole row.
  • The asterisk added by .z-form-label-required is visual only; set the native required attribute for semantics.