Cron Schedule
Visual cron expression display with field breakdown, human-readable summary, and optional next-run preview. Designed for dashboards, serverless function docs, and scheduling UIs.
Preview
Daily Standup Reminder
At 9:00 AM, Mon through Fri
0 9 * * 1-5Next 3 runs
- 1Thu, Mar 12 at 9:00 AM
- 2Fri, Mar 13 at 9:00 AM
- 3Mon, Mar 16 at 9:00 AM
Installation
$ shadcn add https://ui.justinlevine.me/r/cron-schedule.jsonUsage
import { CronSchedule } from "@/components/cron-schedule"<CronSchedule expression="0 9 * * 1-5" title="Daily Standup" />Pass a standard 5-field cron expression. The component parses it into a human-readable summary and a visual field breakdown. Optionally show upcoming run times with showNextRuns.
Examples
Common schedules
Every 15 minutes
Health Check
Every 15 minutes
*/15 * * * *Weekdays at 9 AM
Daily Standup Reminder
At 9:00 AM, Mon through Fri
0 9 * * 1-5Midnight on the 1st
Monthly Cleanup
At 12:00 AM, on day 1 of the month
0 0 1 * *Every hour
Cache Refresh
At minute 0
0 * * * *With next runs
Set showNextRuns to display upcoming execution times. Pass referenceDate to control the starting point (defaults to now).
Next 5 runs
Notification Digest
At 8:30 AM, 12:30 PM, and 5:30 PM, Mon through Fri
30 8,12,17 * * 1-5Next 5 runs
- 1Wed, Mar 11 at 12:30 PM
- 2Wed, Mar 11 at 5:30 PM
- 3Thu, Mar 12 at 8:30 AM
- 4Thu, Mar 12 at 12:30 PM
- 5Thu, Mar 12 at 5:30 PM
Next 3 runs — every 6 hours
Data Sync
Every 6 hours
0 */6 * * *Next 3 runs
- 1Wed, Mar 11 at 12:00 PM
- 2Wed, Mar 11 at 6:00 PM
- 3Thu, Mar 12 at 12:00 AM
Complex expressions
Quarterly report — 1st of Jan, Apr, Jul, Oct at 6 AM
Quarterly Report
At 6:00 AM, on day 1 of the month, in Jan, Apr, Jul, and Oct
0 6 1 1,4,7,10 *Next 4 runs
- 1Wed, Apr 1 at 6:00 AM
- 2Wed, Jul 1 at 6:00 AM
- 3Thu, Oct 1 at 6:00 AM
- 4Fri, Jan 1 at 6:00 AM
Weekends only — Sat and Sun at noon
Weekend Batch
At 12:00 PM, Sun and Sat
0 12 * * 0,6Without title
Omit the title for a compact display that shows only the summary and field breakdown.
Minimal
Every 5 minutes
*/5 * * * *API Reference
CronSchedule
Cron syntax reference
| Field | Values | Specials |
|---|---|---|
| Minute | 0–59 | * , - / |
| Hour | 0–23 | * , - / |
| Day (Month) | 1–31 | * , - / |
| Month | 1–12 | * , - / |
| Day (Week) | 0–6 (Sun–Sat) | * , - / |
Notes
- Server component. No
"use client"— renders entirely on the server with zero client JS. - Standard 5-field only. Supports minute, hour, day-of-month, month, and day-of-week. Does not support seconds, years, or non-standard extensions like
L,W, or#. - No dependencies. Cron parsing and next-run computation are built-in. No external scheduling library required.
- Next-run accuracy. Runs are computed by iterating minute-by-minute from the reference date, capped at ~1 year of lookahead. This is suitable for display purposes — not a production scheduler.
- Timezone. Next-run times use the server's local timezone (or the timezone of the provided
referenceDate). No timezone conversion is applied.