docs / core / input

Input

a single line of text you type into. anything longer is a textarea, not a taller Input.

intensity · recedesrsc · client

provenance

authored in usva

layer

core / primitives

intensity

recedes · safe anywhere, including dense surfaces

composition

under a Label, inside form rows and field groupsaria-invalid flags the field the error text points atnever unlabeled. a placeholder is not a labelno search icons or buttons stuffed inside. wrap it instead

a11y

a native <input>, named by a Label or aria-label · aria-invalid paints the danger statejest-axe
live demo · try it out
customize
typenative input type
placeholderhint text, never a label
valuethe starting text
invalidsets aria-invalid, paints danger
disableddims to 50%, not-allowed cursor
usagecopy
import { Input } from "@usva-ui/react/primitives/input";

<Input type="email" placeholder="you@example.com" />

props

proptypedefaultnotes
aria-invalidbooleanfalsedanger border and ring for the field the error text points at.
disabledbooleanfalsedims to 50% with a not-allowed cursor.
…InputHTMLAttributesReact.InputHTMLAttributesevery native input attribute passes straight through.

get it

bun add @usva-ui/reactcopy
usagecopy
import { Input } from "@usva-ui/react/primitives/input";

<Input placeholder="you@example.com" type="email" />
<Input aria-invalid defaultValue="not-an-email" />
<Input disabled placeholder="Disabled" />