Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

Label

Label provides accessible text labels for form controls. Use `htmlFor` to link the label to a form control by its id.

preview

Usage#

import { Label } from '@primereact/ui/label';
<Label />

Examples#

Basic#

An accessible label element associated with a form control.

basic-demo

Required#

You can display required indicators in the label content while keeping the input semantics with required or aria-required.

required-demo

Wrapper#

Label can wrap a form control to associate them implicitly without htmlFor. Useful for card-style selectable options.

wrapper-demo

Disabled#

Label reflects the disabled state of an associated control automatically when the control and label are peers or when the container has data-disabled.

disabled-demo

Accessibility#

Screen Reader#

Label renders a native label element. Use htmlFor to associate it with a form control id, or wrap the form control inside the label.

Keyboard Support#

Component does not include any interactive elements.