Typewriter Button
An interactive button that reveals its label character-by-character with optional synthesized mechanical audio feedback.
Click buttons to test typewriter text reveal + Web Audio mechanical clicks
Installation
Add the component directly to your repository using shadcn CLI:
npx shadcn@latest add Surajmaurya1/easyui/typewriter-button
API Reference
| Prop | Type | Default | Description |
|---|---|---|---|
| children | string | — | Label text to type out |
| charDuration | number | 75 | Milliseconds per character reveal |
| soundEnabled | boolean | false | Enables mechanical keystroke sound cues |
| soundVolume | number | 0.25 | Web Audio synthesizer output volume (0 to 1) |
| variant | 'primary' | 'secondary' | 'outline' | 'primary' | Styling appearance |
| autoStart | boolean | false | Begins typing immediately upon mounting |
| onComplete | () => void | undefined | Callback on typing completion |