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 init
Terminal
npx binhlaig-ui@latest add label

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.

Update or Overwrite

Replace an older Label source with the latest registry version.

npx binhlaig-ui@latest add label --overwrite

API Reference

Main primitives available in Binhlaig UI Label.

APIPurpose
LabelAccessible label for a form control.
htmlForReferences the target form control id.
LabelRequiredVisual required marker.
LabelOptionalOptional field indicator.
classNameCustomize label styling.