Float Label
Markup where the component goes, CSS in your stylesheet. No JavaScript.
HTML
CSS
Paste into Claude, ChatGPT or Cursor after filling in {{USER_STACK}}, {{USER_STYLING}} and {{USER_CONSTRAINTS}}. Neutral keeps the greys you see here; Match my project asks the model to map them onto your own colour tokens.
Install with shadcn
Needs a free account token. Get a token
npx shadcn@latest add @movin/input-float-labelAbout this component
The label lives inside the field at rest and floats above the text on focus or when a value is present. Pure CSS transitions, no dependencies.
Triggers
- Focus
- State change
Techniques
- Transform only
- Transition delay stagger
Difficulty
Intermediate
Accessibility
Keyboard and screen readers
Label is a real <label> with htmlFor: screen readers see it correctly at all times.
Use it in anything you build, commercial and client work included. Licence