Skip to main content

Label

The <Label> component is an accessible label for various form inputs. It uses the htmlFor attribute to associate the label with an input by its id and can be customized via the className prop.

Example

Props

NameDescriptionType
classNameAdditional classes for styling the labelString
childrenContent to be rendered inside the label elementReact.ReactNode
refForwarded reference to the label elementReact.Ref<HTMLLabelElement>
...propsAdditional label properties from HTML attributesHTMLLabelAttributes

Customization

The approach for customization will vary depending on if the customization is intended to be global for all consumers of the UI component or if it is only an override for a particular instance.

  • If the customization is necessary for all use cases, update the component source code in the UI library package directly.
  • Otherwise, pass className overrides to modify styles for a particular instance.