Skip to content

Label ​

<label> with required mark and hint

A label for a control that isn't in a form field — in a toolbar, or a layout of your own. In a form use Field: it renders this label and also wires the id, the description and the error.

Basic
  • required draws the * and nothing else — the mark is hidden from screen readers. Put required on the control, which is what gets announced and validated.
  • hint is read as part of the label, so keep it to a word or two (optional, max 3). A sentence belongs in Field's description, which is read as a description instead.

Usage ​

ts
import { BlessLabel } from "blessing-ui";

API ​

Props

NameTypeDefaultDescription
forstring—
requiredboolean—draws the * only; put `required` on the control too
hintstring—a word or two after the label ("optional"); it is part of the label's accessible name
disabledboolean—

Slots

NameScopeDescription
default—

Released under the MIT License. Character names and artwork belong to their owners.