Haedong
004

Field

Form

Empty

Customize

Control
State
Description

Code

<Field
  label="Email"
  description="Never shared"
>
  <Input type="email" />
</Field>

Install

npx shadcn@latest add https://components.haedong.dev/r/field.json

Props

Extends the native label props. Takes exactly one control as children (Input, Textarea, …) and sets aria-invalid / aria-describedby on it.

PropTypeDescription
labelstringLabel text, muted uppercase.
descriptionstringMuted helper line under the control.
errorstring | false | nullWhen truthy: the control gets aria-invalid, and the message replaces the description at full strength with a "!" prefix.
childrenReactElementThe control. Its own aria-invalid / aria-describedby are preserved.
classNamestringExtra classes for the label element (e.g. width).