How to use the form field styler
- Choose a style: outlined, filled, underline, floating label or pill.
- Pick a size (36, 44 or 52px tall), the corner radius and border width.
- Write the label and hint in your own words.
- Set the colors: border, focus, error, field background, text, placeholder and page background.
- Review the checks and the three preview states.
- Export the HTML, including the error-state markup, with CSS, SCSS, Tailwind or React.
The markup
<div class="field">
<label class="field__label" for="email">Email address</label>
<input class="field__input" id="email" type="email" autocomplete="email" aria-describedby="email-hint">
<p class="field__hint" id="email-hint">We'll never share your email.</p>
</div>
For errors, add field--error, aria-invalid="true" and an error message whose id is in aria-describedby.
Worked examples
Example 1: a sign-up form
Load Outlined. The slate border passes 3:1 on white, the blue focus ring is clearly visible, and the hint sits under the field. Use autocomplete values such as email, name and new-password so browsers can fill them in.
Example 2: a compact settings panel
Load Outlined compact (36px). It’s fine for dense desktop admin screens, and the check notes that 44px is more comfortable on touch devices.
Example 3: a dark app
Load Dark. A lighter slate border on near-black, a sky-blue focus ring and a softened red for errors keep everything readable in dark mode.
Tips
- Never remove the focus style. Replace the default outline with something at least as visible.
- Keep placeholders as examples (“you@example.com”), not instructions.
- Group related fields in a
fieldsetwith alegend. - Show errors after the user leaves a field or submits the form, not on every keystroke.
Common mistakes
- Placeholder as label. It vanishes on typing and usually fails contrast. Always use a real label.
- Red-only errors. Add an icon and a clear message that says how to fix the problem.
- Disabled fields without explanation. If a field is disabled, say why nearby, or keep it editable and validate the value instead.