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.

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.

More optionsFewer options

Focus color

The raised label and the active line or border.

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.

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 GitHub

What it is

The full explanation is in README.md.

Good for

  • Sign-up forms
  • Sign-in forms
  • Checkout
  • Settings

Avoid on

  • Long labels