Label

Renders an accessible label associated with controls.

@react.component
let make = () =>
  <div className="flex gap-2">

Installation

npx shadcn@latest add @rescript-shadcn/Label

Usage

<Label htmlFor="email"> {"Your email address"->React.string} </Label>

Label in Field

For form fields, use the Field component which includes built-in FieldLabel, FieldDescription, and FieldError components.

<Field>
  <Field.Label htmlFor="email"> {"Your email address"->React.string} </FieldLabel>
  <Input id="email" />
</Field>
let months: array<BaseUi.Select.Item.t<string>> = [
  {label: "MM", value: ""},
  {label: "01", value: "01"},

API Reference

See the Base UI Label documentation for more information.