Skip to main content
The Label component provides accessible labels for form controls with built-in support for required field indicators and consistent sizing.

Basic usage

Props

'small' | 'medium' | 'large'
default:"'small'"
Size of the label text.
boolean
default:"false"
Whether to display a required field indicator.
string
default:"'*'"
The character or text to display for required fields.
string
The ID of the form control this label is associated with.
string
Additional CSS classes to apply.
ReactNode
The label text content.

Required fields

Indicate required fields with an asterisk or custom indicator.

Custom required indicator

Sizes

Three size options for different form layouts.

Complete form field

With checkbox

With radio buttons

Accessibility

  • Always use the htmlFor prop to associate labels with their form controls
  • The required indicator includes aria-hidden="true" and role="presentation" to prevent redundant screen reader announcements
  • Ensure the associated input has the required attribute when using the required indicator
  • Use clear, descriptive label text that explains the purpose of the form control
  • InputField - Text input component with built-in label support
  • Checkbox - Checkbox component with label support
  • Radio - Radio button component