Binhlaig UI Component
Label
An accessible text label for form controls, with required and optional indicators.
Installation
Initialize Binhlaig UI once, then install Label using the saved installer.
Initialize first
npx binhlaig-ui@latest initTerminal
npx binhlaig-ui@latest add labelImport
Import Label and helper indicators.
import {
Label,
LabelOptional,
LabelRequired,
} from "@/components/ui/label"Basic
Associate a label with an input using htmlFor and id.
Required
Show a required marker while keeping the input itself marked required.
Optional
Show that a field does not require a value.
With Checkbox
Pair Label with Checkbox for a larger clickable target.
Disabled Control
Labels can be paired with disabled form controls.
Update or Overwrite
Replace an older Label source with the latest registry version.
npx binhlaig-ui@latest add label --overwriteAPI Reference
Main primitives available in Binhlaig UI Label.
| API | Purpose |
|---|---|
Label | Accessible label for a form control. |
htmlFor | References the target form control id. |
LabelRequired | Visual required marker. |
LabelOptional | Optional field indicator. |
className | Customize label styling. |