Binhlaig logoBinhlaig UI
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 label

For 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.

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