Desk accessories · component · 17K
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.
pnpm dlx shadcn@latest add @s7ui/alarm-clockThis example also uses @s7ui/button @s7ui/window.
Alarm 07:30, off. The alarm has not gone off yet.