Binhlaig UI Component
Label
An accessible text label for form controls, with required and optional indicators.
Installation
Install Label in your project.
Terminal
npx binhlaig-ui@latest add labelFor project setup, installer selection, dependencies, and advanced installation instructions, see the Installation Guide.
View Installation Guide →Update or Overwrite →Import
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.
API 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. |