search ESC

Floating Labels

Material-style labels that float above the input on focus or when the field has a value. Wrap the input and label together in .lp-form-floating — the trigger is the native :placeholder-shown pseudo-class, so always include a non-empty placeholder attribute (even if it's just a space).

Basic
Pre-filled
Textarea with floating label
Native select with floating label
Disabled / readonly
CSS reference
ClassPurpose
.lp-form-floatingWrapper that gives the label floating behavior. Contains a .lp-input/.lp-textarea/.lp-select-native followed by a <label>.

Remember: the input must have a placeholder attribute (a single space " " is fine) for the floating animation to trigger.