Variants
Sizes and states, built from the same markup (only the main demo drives the machine).
Usage
Paste the markup, include assets/css/tokens.css and assets/css/tailwind.css, then run the script from this page.
Accessibility
- Native textarea. The field is a real textarea with an accessible name, maxlength and a visible counter, so screen readers, spellcheck, IME and autofill all work. The typewriter is aria-hidden decoration.
- Keyboard. Type as normal. Every key strikes a bar; Space ticks the carriage, Backspace slides it back, Enter rolls the platen and rings the bell. "Tear off sheet" is a normal button.
- Announcements. Tearing off the sheet is announced politely ("Sheet torn off. A fresh sheet is loaded.") and focus stays in the field.
- Reduced motion. With prefers-reduced-motion the sheet is replaced instantly on tear-off and the typewriter stays still; typing and the counter behave exactly the same.