Introducing PrimeReact v11-alpha 🎉Discover Now
styledForm

FloatLabel

FloatLabel visually integrates a label with its form element.

Click to see the floating label
preview

Usage#

import { FloatLabel } from '@primereact/ui/floatlabel';
<FloatLabel></FloatLabel>

Examples#

Basic#

A label that transitions above the input field when focused.

basic-demo

Variants#

The variant property defines the position of the label. Default value is over, whereas in and on are the alternatives.

variants-demo

Invalid#

When the form element is invalid, the label is also highlighted.

invalid-demo

Accessibility#

Screen Reader#

FloatLabel does not require any roles and attributes.

Keyboard Support#

Component does not include any interactive elements.