GitHubnpm

Accent theme

Base radius

GitHubnpm

Accent theme

Base radius

Colour scheme

Docs menu

Guides


Primitives
Forms
Layout
Feedback
Overlays
Navigation
Data Display
AI

Text Field

A real <label> linked to a real <input>, with aria-describedby wired up to hint and error text automatically.

Playground

Toggle every adjustable prop and watch the component — and the code — update live.

We'll never share your email.

Unstyled

Same component — Kernel look stripped. See Platforms.

type
size
invalid
required
disabled
hide label
label offset
Usage
<TextField label="Email" placeholder="you@example.com" type="email" description="We'll never share your email." errorMessage="Enter a valid email address." />

Props

Props for Text Field.
PropTypeDefault
labelReactNode (required)
hideLabelbooleanfalse
descriptionReactNode
errorMessageReactNode
invalidbooleanfalse
size"sm" | "md" | "lg""md"
classNamestring | (state) => string — control
wrapperClassNamestring | (state) => string
labelClassNamestring | (state) => string
descriptionClassNamestring | (state) => string
errorClassNamestring | (state) => string

Floating labels

The wrapper exposes data-focused and data-filled(and the same flags in className state callbacks) so unstyled consumers can animate floating labels for controlled values, uncontrolled values,defaultValue, user input, and browser autofill where practical.

Accessibility

  • Clicking the label focuses the input, that's a native label/input association, not a click handler.
  • :user-invalid handles live validation styling after the user has interacted with the field, with no blur-tracking JavaScript.
  • The invalid prop is for validation you already know about, like a failed server response, before the user has touched anything.