04.14 · Micro-Interactions
Form Field Morph
The label moves up out of the way as you type. Best for sign-up forms.
Click it
Click or tap a field and type, or press Show me.
Inside, the label is drawn in both of its places: inside the empty field, and raised and smaller once you click or type. Click a field and type, or press Show me.
Shown with a name typed in: Placeholder only has lost its hint, so you forget what the field was for; Floating label keeps it above the text. Click and type, or Show me.
Try it
Change a setting, then try it again or press Show me.
Speed
Slow feels heavy on a long form.
How far it rises
Far enough to clear the text you type.
Size when raised
Smaller stays out of the way; larger reads easily.
Copy the prompt
Paste it into an AI assistant such as ChatGPT, Claude or Cursor to build this in your own project.
Add floating labels to [the form fields you want to label]. Each label sits inside its field like a placeholder; when the field is focused or has text in it, the label moves up and shrinks so it stays visible above the text, and the field's line or border takes on the focus color. When an empty field loses focus, the label moves back down. Keep a real label element for each field so screen readers announce it, and shrink the label from its left edge so it does not drift sideways. If the visitor has reduced motion turned on, move the label without animating it. Match the settings listed below.
Your settings
Replace the words in brackets with your own element. Your settings are added at the end.
Free and open source. If this helped, a star on GitHub helps other people find it.
Star on GitHubWhat it is
The full explanation is in README.md.