Variants
Three sizes and states, built from the same markup.
Usage
Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.
Accessibility
- Native controls. A real form: a password input with an accessible name, a toggle button with aria-pressed (Show/Hide password) and a submit button. The mascot is aria-hidden decoration.
- Keyboard. Tab through input, eye button and submit; Enter submits. Focus rings use the --ring token. The mascot reacts to the same events, so keyboard users get the full show.
- Announcements. The hint line is a polite live region. Strength changes, errors ("Needs 8+ characters and a number") and success are spoken. The input gets aria-invalid on error.
- Reduced motion. With prefers-reduced-motion the mascot snaps between poses (eyes covered, peek, happy) with no hop, shake or confetti. The text feedback is unchanged.