Ballmac UI home

Cron 1: scheduled jobs

The scheduled jobs of a product: each schedule in plain words beside its cron expression, an on and off switch, the last run written out, the next runs, and a Run now button that asks first.

State

The normal view. Pick a state to see what the block shows while it loads, is empty or fails.

Open in v0 (opens in a new tab)

Installation

$ pnpm dlx shadcn@latest add @ballmac/cron-1

Usage

Example: cron-1-demo.tsx
"use client"

import { Cron1 } from "@/components/ballmac/blocks/cron-1/cron-1"

export default function Cron1Demo() {
  return <Cron1 onToggle={() => new Promise((r) => setTimeout(r, 400))} onRunNow={() => new Promise((r) => setTimeout(r, 400))} />
}

States

Pass state and the block does the rest: skeletons that match its layout, a clear empty message, an error you can retry, and announcements for screen readers.

  • Loading

    Skeleton rows under the real heading, announced as loading.

    state="loading"
  • No scheduled jobs

    Says no scheduled jobs; emptyState sets the copy.

    state="empty"
  • Could not load

    An alert saying nothing was changed or started, with Try again (onRetry). A switch that fails goes back and says why.

    state="error"

Dependencies

Use with AI

Scheduled jobs. <Cron1 jobs={[{ id, name, schedule: '0 9 * * 1-5', timezone?, enabled, owner?, last?: { status: 'success' | 'failed' | 'running', at, duration? }, next?: string[] }]} onToggle={(job, enabled) => Promise} onRunNow={(job) => Promise} />. Exports describeCron(expr), which turns common five-field expressions into a sentence (every N minutes or hours, daily, weekdays, weekends, one weekday, monthly) and says 'A custom schedule' for the rest instead of guessing. With the shadcn MCP server set up (guide), ask your agent:

Add the Ballmac UI Cron 1: scheduled jobs (@ballmac/cron-1) to this project with the shadcn MCP, then use it where it fits.

Use it for

  • An admin page for cron jobs and background schedules
  • Letting a team pause a job or run it once by hand

Not for

  • The workers and their failed jobs; use queues-1
  • Automations built by users with triggers and steps; use workflow-1

Registry JSON: https://ui.ballmac.com/r/cron-1.json

Free to use in personal and commercial projects.

Ballmac UI Pro

Need the whole screen, not one piece?

150 premium blocks (dashboards, settings, calendars, mail, shops, onboarding), a private shadcn registry and Figma tokens. Blocks that show data come with loading, empty and error states built in.

Not ready? Try three Pro blocks free

Leave your email and the blocks appear right here, ready to copy. Yours to use in any project.