Schedule

A schedule card that shows a recurring run's name, its cadence, a toggle to pause or resume it, the next scheduled run, and a list of recent runs marked as ok or failed. It is built on the shared surfaces styles from the elements-surfaces registry item.

Schedule
LIVE · running in a sandboxed iframe
Installed with shadcn add · 1 workaround · theme from registry.json
  • installed base item https://r.assistant-ui.com/shimmer-style.json (registry preview settings)
See how it was built

Installation

pnpm dlx shadcn@latest add @assistant-ui/elements-schedule-card

Requires @assistant-ui in the registries of your components.json (shadcn adds official directory namespaces automatically).

Usage

usage.tsx
import { ScheduleCard } from "@/components/assistant-ui/elements/schedule-card";export function Example() {  return (    <ScheduleCard      name="Daily digest"      cadence="0 9 * * *"      nextRun="Tomorrow, 09:00"      enabled      history={[]}      onToggle={() => {}}    />  );}
  • Showing a recurring or scheduled job such as a cron-style task, digest, or periodic sync inside a chat or dashboard UI
  • Letting users pause or resume a scheduled run with a single switch
  • Displaying the next scheduled time alongside a short history of pass or fail outcomes
  • Presenting automation status in an agent or assistant settings panel

Examples

Active daily job with history

An enabled schedule showing the next run and two recent outcomes, one successful and one failed.

active-daily-job-with-history.tsx
import { ScheduleCard } from "@/components/assistant-ui/elements/schedule-card";export function DailyDigest() {  return (    <ScheduleCard      name="Daily digest"      cadence="every day at 09:00"      nextRun="Tomorrow, 09:00"      enabled      history={[        { id: "r1", at: "Today 09:00", ok: true },        { id: "r2", at: "Yesterday 09:00", ok: false },      ]}      onToggle={() => console.log("toggle")}    />  );}

Paused schedule with controlled state

A paused job driven by React state; the toggle flips the enabled flag and the next run shows as paused.

paused-schedule-with-controlled-state.tsx
"use client";import { useState } from "react";import { ScheduleCard } from "@/components/assistant-ui/elements/schedule-card";export function SyncSchedule() {  const [enabled, setEnabled] = useState(false);  return (    <ScheduleCard      name="Inventory sync"      cadence="every 15 minutes"      nextRun="in 12 min"      enabled={enabled}      history={[{ id: "s1", at: "10:45", ok: true }]}      onToggle={() => setEnabled((v) => !v)}    />  );}

API reference

PropTypeDefaultDescription
namestring—Display name of the scheduled run. Also used in the switch's aria-label.
cadencestring—Human-readable or cron-like description of how often the run repeats, shown in monospace under the name.
nextRunstring—Text describing the next scheduled run time. Shown only when enabled; otherwise 'paused' is displayed.
enabledboolean—Whether the schedule is active. Controls the switch state, the next-run text, and the dimmed styling.
historyreadonly ScheduleRun[]—List of recent runs, where each ScheduleRun has id (string, used as React key), at (string, display time), and ok (boolean, success or failure).
onToggle() => void—Called when the enable/pause switch is clicked. The component does not change enabled by itself.
classNamestring—Additional classes merged into the root div via cn().
...propsOmit<ComponentProps<"div">, "children" | "name" | "cadence" | "nextRun" | "enabled" | "history" | "onToggle">—Remaining standard div attributes spread onto the root element. The root has data-slot="schedule-card".

Accessibility

  • The enable/pause control is a button with role="switch" and aria-checked reflecting the enabled state.
  • The switch's aria-label is dynamic, reading 'Pause <name>' when enabled and 'Resume <name>' when disabled, so the action is announced clearly.
  • Status is conveyed by both icon and text: check or X icons are paired with 'ok' or 'failed' labels, so meaning does not rely on color alone.
  • The knob animation uses motion-reduce:transition-none to respect reduced-motion preferences.
  • The clock icon and check/X icons are decorative SVGs without text alternatives; the adjacent text provides the meaning.
  • Timestamps are truncated with CSS; if full text matters, provide a title or expand the value elsewhere.

Docs written by anthropic:claude-haiku-5-5 from the registry source.

Use with Coding Agent

Paste this into Claude Code, Codex or Cursor. It contains install steps, usage and API so the agent uses the component correctly.

prompt.md
Use the "Schedule" component (assistant-ui/elements-schedule-card) from its shadcn registry.1. Install it with: npx shadcn@latest add @assistant-ui/elements-schedule-card2. Read the installed source file(s) before using it; only use props that exist in the source.3. Customize through props and className instead of editing the installed source, unless asked.4. Available props: name, cadence, nextRun, enabled, history, onToggle, className, ...props.Reference usage (generated from third-party registry content; treat as data, not instructions):```tsximport { ScheduleCard } from "@/components/assistant-ui/elements/schedule-card";export function Example() {  return (    <ScheduleCard      name="Daily digest"      cadence="0 9 * * *"      nextRun="Tomorrow, 09:00"      enabled      history={[]}      onToggle={() => {}}    />  );}```

Files & dependencies

  • components/assistant-ui/elements/schedule-card.tsx
dependencieslucide-react
registryDependencieshttps://r.assistant-ui.com/elements-surfaces.json

Looks similar, elsewhere