CronField

Displays a 5-field cron expression as a human-readable phrase via cronstrue.

Installation

pnpm dlx shadcn@latest add @shadmin/cron-field

Usage

import { CronField } from '@/components/admin';
 
<CronField source="schedule" />
<CronField source="schedule" showExpression />
<CronField source="schedule" empty="No schedule set" />

Props

PropRequiredTypeDefaultDescription
sourceRequiredstring-Record field to read
showExpressionOptionalbooleanfalseShow the raw cron string below the phrase
emptyOptionalReactNode-Fallback when value is null/empty
classNameOptionalstring-CSS class on <span>

Storage format

Standard 5-field cron syntax (min hr dom mon dow). Quartz/seconds-resolution is not supported in v1. Invalid expressions render the raw string in muted monospace.