Label
A native label with Zenos typography and disabled-state styling.
A native label with Zenos typography and disabled-state styling.
Import
Section titled “Import”import { Label } from "@zentara-co/zenos-ui";Control association
Section titled “Control association”Use htmlFor with a matching control id, or wrap a native labelable control. Clicking either label moves focus to or activates its associated control.
Label or Field.Label
Section titled “Label or Field.Label”Use standalone Label for a simple native association. Use Field.Label when the control also needs generated IDs, a description, an error, or inherited required, disabled, and invalid semantics.
Receives incident notifications.
Required, optional, and tooltip
Section titled “Required, optional, and tooltip”Pass required to show the design-system asterisk, optional (or a custom string) for (Optional) copy, and tooltip with tooltipLabel for an info trigger that opens supporting text.
Disabled and required presentation
Section titled “Disabled and required presentation”Standalone Label uses the same header layout and affordances as Field.Label. Pass required, optional, and tooltip on the label itself, and set disabled (or data-disabled) when the paired control is disabled so the asterisk, optional copy, and info trigger match field styling.
API
| Prop | Type | Default | Description |
|---|---|---|---|
htmlFor | string | — | ID of the labelled form control. |
required | boolean | — | Shows a required asterisk after the label text. |
optional | boolean | string | — | Shows optional copy beside the label. true renders (Optional). |
tooltip | ReactNode | — | Tooltip content for the info trigger beside the label. |
tooltipLabel | string | — | Accessible name for the info trigger. |
disabled | boolean | — | Mutes the label and affordances to match a disabled control. |
data-disabled | boolean | string | — | Alternative disabled presentation hook when not using the disabled prop. |
native props | React.LabelHTMLAttributes<HTMLLabelElement> | — | Forwards native attributes, events, aria-*, data-*, className, style, and ref. |
Unless narrowed above, each DOM-rendering part also accepts its underlying native or Base UI props,
including className, style, aria-*, and data-*.
Accessibility
Section titled “Accessibility”Label renders a native label. Keep its text concise and specific, and do not replace it with placeholder text. Every htmlFor must match one labelable control’s id. Wrapped controls preserve the browser’s native click behavior.