Floating label

Also called float label or floating placeholder

A form field whose label sits inside the input like a placeholder, then shrinks and moves to the top edge when you focus or type.

What is Floating label?

A floating label starts inside the empty field, where a placeholder would be. When the field gets focus or has a value, the label scales down and slides up to the top edge, so it stays visible while you type. The pattern spread widely after Google’s Material Design adopted it.

It saves vertical space in compact forms such as sign-in, checkout, and mobile screens while keeping a real label on screen. A plain placeholder disappears as soon as someone starts typing, so they can lose track of what the field was for; a floating label stays put.

Keep the floated label large enough to read, at least 12px, and animate it with transform over about 150 to 200ms. Use a real <label> tied to the input. In CSS, :focus and :placeholder-shown cover both states without JavaScript, as long as the input has a placeholder of a single space.

All terms

Inline validation

Form checking that happens right next to each field as you fill it in, showing an error or a checkmark before you press Submit.

Focus ring

An outline that marks which element has keyboard focus, so people moving through a page with the Tab key can see where they are.

Transform origin

The point an element rotates and scales around. It defaults to the center, and moving it changes where a transform seems to start.

Interaction states

The set of looks a control takes as people use it, such as default, hover, pressed, focused, and disabled, each showing what will happen.