Input
uistableInput — extracted 1:1 from WEM-App.
npx shadcn add @krawma/inputregistry: @krawma/utils
Preview
States
focus-visibledisabledaria-invalid
Depends on
utils
Purpose
A single-line text field for free-form entry (text, email, password, number, etc.
via the native type). For numeric entry with sanitization/clamping use
number-input; for a date use date-picker; for multi-line use textarea.
Anatomy
Single styled native <input> (data-slot="input"). It is intentionally
uncontrolled-by-default and forwards all native props.
Style
- No variants — one canonical look. Sizing is fixed (
h-8) to align withbutton/selecton a row; width is100%(the parent controls layout). - Uses tokens only (
border-input,bg-transparent/dark:bg-input/30,placeholder:text-muted-foreground).
Behavior & functionality
- Fully controlled or uncontrolled per native semantics; pass
value+onChangeto control. - Pair with
label(viahtmlFor/id) — the design system does not auto-render a label.
Accessibility
- Must have an associated
<Label>oraria-label. - States to honor:
focus-visible(ring on--ring),disabled(non-interactive, muted,cursor-not-allowed), andaria-invalid(danger ring/border) — setaria-invalidwhen the field fails validation and wire an error message viaaria-describedby.
Do / Don't
- ✅ Set
aria-invalid+aria-describedbyon validation errors. - ✅ Use the native
typefor semantics/keyboards (email,tel,url). - ❌ Don't build a numeric field from a raw
Input— usenumber-input. - ❌ Don't hard-code a fixed pixel width on the input; size the container.