labsUI

Forms

Input, Textarea, Label and Switch: smooth focus rings, native :user-invalid validation (red only after interaction), aria-invalid, auto-growing textarea with an optional character count, and a spring switch.

npx @kznlabs/labsui add input textarea label switch

Create account

Focus, invalid and disabled states.

0/160 characters used

<Input>

Works inside <Field> (id and ARIA filled in) and <InputGroup> (chrome handed to the group).

Also accepts every <input> prop (none of its own).

<Textarea>

Auto-grows with content (field-sizing: content); cap with max-h-*. Resizable where unsupported (Firefox).

  • showCount
    boolean

    Show "used / maxLength" in the corner (needs maxLength). Turns warning, then red, near the end.

PropTypeDefault
showCount

Show "used / maxLength" in the corner (needs maxLength). Turns warning, then red, near the end.

boolean—

Also accepts every <textarea> prop.

<Label>

Also accepts every <label> prop (none of its own).

<Switch>

Native checkbox (role="switch") with a spring knob. Controlled or uncontrolled.

  • checked
    boolean

    Controlled state; pair with onCheckedChange.

  • defaultCheckeddefault false
    boolean

    State at first render (uncontrolled).

  • onCheckedChange
    (checked: boolean) => void

    Called with the new state.

PropTypeDefault
checked

Controlled state; pair with onCheckedChange.

boolean—
defaultChecked

State at first render (uncontrolled).

booleanfalse
onCheckedChange

Called with the new state.

(checked: boolean) => void—

Also accepts every <input> prop.

* required. Every component also takes className.