About this set
Three fields where the label starts inside the input, like a placeholder, and rises to the top edge when the field is focused or has a value. Bordered is a white field with a slate border; the label shrinks to 78% and sits above the typed text. Filled uses a light slate ground with a bottom rule, a common look in Material-style forms. Notched border lifts the label onto the border itself so it cuts a gap in the outline, which needs the label background to match whatever the field sits on. Unlike placeholder-only designs, the label is a real label element that stays visible after typing and stays clickable. The technique is CSS only: the input comes before its label, carries placeholder=” ” (a single space), and the label moves with :focus and :not(:placeholder-shown), which also catches browser autofill. The Bootstrap version is the stock .form-floating component resized and recoloured, with the notched variant added in a few lines; the Tailwind version uses peer, peer-focus and peer-placeholder-shown.
What’s included
- Three variants: bordered, filled and notched border
- Real label elements that stay visible and clickable after typing
- CSS only: :focus and :not(:placeholder-shown), no JavaScript
- Floats for browser autofill as well as typing
- Bootstrap version built on .form-floating
Accessibility
Each input is named by a real label element, so screen readers read the field name whether the label is resting or raised. Resting label text reaches 4.5:1 on both the white and tinted grounds, and the raised label is blue at 4.5:1 or better. Focus turns the border blue and adds a 3px ring. The label movement and colour change are removed under prefers-reduced-motion.
Customise it
In plain CSS change --fl-border, --fl-focus, --fl-label, --fl-fill and --fl-surface on .fl; set --fl-surface to the colour behind a notched field. In Bootstrap the same custom properties live on .flx next to --bs-border-color; in Tailwind edit the colour classes on the input and label.






