Desk accessories · component · 17K

Alarm Clock

A compact clock strip in the spirit of the classic Alarm Clock desk accessory: the time with ticking seconds and a disclosure that opens the date and an alarm row with hour and minute spin buttons, little arrows and an alarm-clock toggle. When the alarm goes off, onAlarm is called and the clock icon flashes.

Client-only time (the server renders an empty strip, so no hydration mismatch). The alarm is a 24-hour "HH:MM" string, controlled or not, as are alarmOn and expanded. The component never makes a sound: play one in onAlarm. The flashing icon stops when clicked or when the alarm is switched off, and stays still under prefers-reduced-motion. AlarmClockIcon (with ringing and flashing) is exported for your menu bar.

Install

pnpm dlx shadcn@latest add @s7ui/alarm-clock

Example

This example also uses @s7ui/button @s7ui/window.

Date
Alarm
0730

Alarm 07:30, off. The alarm has not gone off yet.

Info

Files:
components/retro/alarm-clock.tsx
Uses:
@s7ui/theme, @s7ui/bitmap, @s7ui/little-arrows
Packages:
—