Label

An accessible label for form controls. For full fields with description and error text, prefer Field and FieldLabel.

Basic

Associate a label with a control via htmlFor and matching id.

Installation

CLI
npx @sonojs/ui@latest add label

Usage

label.tsx
import { Label } from "@/components/ui/label"

export function Example() {
  return <Label htmlFor="email">Your email address</Label>
}

Props

PropTypeDefaultDescription
htmlForstring—Id of the labeled control.
classNamestring—Merge extra Tailwind classes on the label.