Componenteditors1.18 KB gzipZero dependencies
Cron Builder
Cron expression builder: 5 fields, presets, live description.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add cron-builderOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { CronBuilder } from "@/components/ui/cron-builder"; <CronBuilder />Source code
cron-builder.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxcron-builder.tsx95 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface CronBuilderProps extends React.HTMLAttributes<HTMLDivElement> { value?: string; defaultValue?: string; onValueChange?: (expression: string) => void;} const FIELDS = [ { key: "minute", label: "Minute", placeholder: "0-59" }, { key: "hour", label: "Hour", placeholder: "0-23" }, { key: "dom", label: "Day of month", placeholder: "1-31" }, { key: "month", label: "Month", placeholder: "1-12" }, { key: "dow", label: "Day of week", placeholder: "0-6" },] as const;Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { CronBuilder } from "@/components/ui/cron-builder"; <CronBuilder />| Prop | Type | Description |
|---|---|---|
| value | string | Controlled value. |
| defaultValue | string | Initial value when uncontrolled. (Default: "0 9 * * *") |
| onValueChange | (expression: string) => void | Callback invoked on value change. |