Retro hardware handheld clock
Tactile skeuomorphic industrial timer and standby clock with morphing dot-matrix typography, rocker switches, and synthesized mechanical audio.
- Dependencies (1)
Overview and background
The retro hardware handheld clock draws direct aesthetic inspiration from 1980s portable electronic test instruments, pocket synthesizers, and vintage Japanese industrial design. Encased in a brushed, warm anodized aluminium chassis with milled edge bevels and precision panel grooves, the component couples skeuomorphic realism with contemporary responsive web engineering. Inside the recessed OLED window, a persistent dot-matrix bitmap engine morphs digit segments smoothly without DOM unmounts, while procedural Web Audio synthesizer nodes generate authentic mechanical micro-switch clicks, timer beeps, and confirmation chimes without downloading external audio assets.
Features
- Pixel-perfect dot-matrix typography: Custom 10x13 and 6x13 bitmap grids render digits with scalable vector dots and smooth CSS morphing transforms.
- Synthesized hardware audio: Built-in zero-asset Web Audio API oscillator chains simulate tactile rocker clicks, start chimes, and completion alarms.
- Interactive rocker and trigger controls: 3D-angled rocker button cycles through presets or fine-tunes time increments with realistic mechanical depression shadows.
- Radial timer progress indicator: Circular action button with animated SVG stroke dash offsets and rotating engraved calibration rings.
- Multiple hardware presets: Standby reference clock (01:00), Pomodoro focus sprint (25:00), Deep work block (45:00), and Recovery break (05:00).
- Keyboard navigation: Full keyboard shortcut support via arrow keys, Space, Enter, and Escape.
Use cases
- Focus and productivity tools: Embedded Pomodoro and sprint countdown timers in modern productivity dashboards.
- Developer portfolios and landing pages: High-impact interactive hero widget that showcases creative frontend design engineering.
- Creative workstations and dashboards: Companion desk clock widget for creative studios, audio workstations, or ambient dashboards.
- Skeuomorphic hardware showcases: Tactile micro-interaction demonstrations highlighting physical UI paradigms on the web.
Installation
pnpm dlx shadcn@latest add @abushaidislam/retro-hardware-handheld-clock
Usage
import RetroHardwareHandheldClock from "@/components/retro-hardware-handheld-clock"export default function ClockPage() {
return (
<div className="flex min-h-[440px] items-center justify-center p-6">
<RetroHardwareHandheldClock initialPresetIndex={0} soundEnabled={true} />
</div>
)
}Composition
Use the following composition to build a RetroHardwareHandheldClock
RetroHardwareHandheldClock
└── ViewportStage
└── HardwareCasing (Anodized chassis + seam grooves + checkerboard emblem)
├── RecessedOLEDWindow
│ ├── DotMatrixSunIcon (Morphing particle matrix)
│ ├── TopStatusLine (FAIR 30° / Mode indicator)
│ ├── DotMatrixClock (Persistent 10x13 digit slot matrix)
│ └── BottomSubtextLine (Calendar / Session status)
├── TactileRockerButton (3D dual-action rocker switch)
├── ActionButton (Circular confirm button + SVG progress arc)
└── KatakanaEngraving (Milled Master badge)API reference
Props
| Prop | Type | Default | Description |
|---|---|---|---|
initialPresetIndex | number | 0 | Zero-based index of the initial preset (0: Standby, 1: Focus, 2: Deep work, 3: Rest). |
initialStatus | "IDLE" | "RUNNING" | "PAUSED" | "COMPLETED" | "IDLE" | Initial timer state when mounted. |
soundEnabled | boolean | true | Enables or disables the procedural Web Audio feedback synthesis. |
className | string | undefined | Additional CSS classes applied to the outer container. |
Hardware presets
The component exports HARDWARE_PRESETS for reading or extending preset configurations:
import { HARDWARE_PRESETS } from "@/components/retro-hardware-handheld-clock"| Preset ID | Label | Accent | Time | Mode |
|---|---|---|---|---|
reference-standby | FAIR | 30° | 01:00 | Clock standby / ambient |
pomodoro-25 | FOCUS | 25M | 25:00 | Pomodoro session 01 |
deep-work-45 | DEEP | 45M | 45:00 | Deep work sprint 02 |
rest-break-05 | REST | 05M | 05:00 | Recovery break 03 |
Accessibility
- The screen region uses
role="region"andaria-live="polite"so state transitions and countdown updates are announced politely by assistive technology without interrupting screen reader speech. - Interactive controls use native
<button>tags with descriptivearia-labelattributes indicating the action and current operating state. - Keyboard navigation is fully supported:
ArrowUp: Step preset or increment timer by 1 minute.ArrowDown: Step preset or decrement timer by 1 minute.Enter/Space: Start, pause, resume, or reset the countdown.Escape/r: Reset device to default standby clock state.
- Keyboard event listeners automatically ignore keystrokes when focus is inside text inputs, textareas, or editable elements.
Frequently asked questions
Does the audio require external MP3 or WAV audio files?
No. The sound engine uses the browser's native Web Audio API (AudioContext, OscillatorNode, and GainNode) to synthesize square, sine, and triangle waveforms on the fly. It has zero network latency, consumes zero asset bandwidth, and gracefully falls back to silence if audio is disabled or blocked by browser autoplay policies.
How does the clock maintain smooth animations without re-rendering the DOM?
Each digit slot renders a fixed 10x13 matrix of vector <rect> elements that remain mounted in the DOM. Transitions between numbers toggle CSS opacity, transform: scale(), and fill properties on existing elements, avoiding costly DOM node insertions or layout thrashing.
Can the widget be embedded in small card layouts?
Yes. The widget is styled with max-w-full and centers neatly within any parent container. On smaller mobile viewports, wrap it in a container with horizontal scroll or scale down the stage transform to fit compact layouts.
License and usage
- Free to use and modify in both personal and commercial projects.
- Attribution is appreciated but not required.
- Released under the MIT License.