Skip to content
Sign upPro
ComposerSchedule sendMenu

Schedule send (Pro)

ProIncluded in $99

Run a prompt later or on a schedule: presets with the real time they mean, a custom time, repeat, the time zone written out, and Undo right after.

ProAn ops lead turns an ask into a weekly digest: Weekly, then Monday morning, then Schedule, with Undo right after.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/schedule-send

Needs chatcn Pro

This command works with a Pro license, along with every Pro component.

Or start free: sign up and get three Pro components on us, with a new one every month.

Usage

tsx
import { ScheduleSend } from "@/components/ui/chatcn/pro/schedule-send"

<ScheduleSend
  timeZone="Europe/Lisbon"
  onSubmit={({ text, schedule }) => (schedule ? queue(text, schedule) : send(text))}
  onUndo={({ text }) => unqueue(text)}
/>

The clock beside Send opens a panel. Each preset shows the time it actually means (In 1 hour 15:05, Tomorrow morning Thu 09:00), presets that make no sense right now disappear (no This evening at 19:20), and a custom date and time refuses the past with the time it will accept. Repeat runs once, daily, on weekdays or weekly. Once a time is set it sits above the text as a line you can change or drop, and Send becomes Schedule. After scheduling the message leaves the field and a notice says when it runs, with Undo until a hairline runs out; moving the pointer over it or focusing it holds the clock. Times are read and written in timeZone, and the zone is always shown in the panel. ScheduleSendPanel is exported on its own for a scheduler elsewhere in your app.

Examples

States

ProNothing set, once, repeating on weekdays, just scheduled with Undo, the panel late in the day with a time in the past, streaming and disabled.

Props

PropTypeNotes
schedule, defaultSchedule, onScheduleChange{ at: Date; repeat } | nullrepeat is "none" | "daily" | "weekdays" | "weekly"
onSubmit({ text, schedule }) => voidschedule is null when the message was sent right away
onUndo, undoMs(submission) => void, numberUndo window, default 6000 ms
timeZone, localestringIANA zone and locale. Default: the reader's
presetsSchedulePreset[]{ id, label, at(now, timeZone) }; return null to hide one
nowDateA fixed clock for previews and tests
defaultPanelOpen, defaultNoticeOpen states, for previews
value, defaultValue, onValueChangestringThe draft, controlled or not
status, onStop"idle" | "submitting" | "streaming", () => voidSend becomes Stop in the same footprint
disabledboolean
tools, attachmentsReactNodeToolbar start, above the text
labelsPartial<ScheduleSendLabels>Every string, for translation

Keyboard

KeyAction
TabMove through the presets, the date and time, repeat and Set time
Left, Right in RepeatChoose once, daily, weekdays or weekly
EscapeClose the panel, focus back in the text
Enter, Shift EnterSchedule (or send), new line. Never while an IME is composing

Accessibility

  • The clock button is named Send later; the time line names what it opens: Change the time, then the time.
  • A time in the past marks both fields invalid and points them at the message that says what to pick.
  • Scheduling is announced politely, and Undo is a real button that stays while it has focus.
  • Repeat is a toggle group, so arrow keys move through it and the pressed state is announced.

Motion

The panel opens from the clock; the notice enters with a short rise and its hairline drains linearly for the undo window. Under reduced motion the hairline is hidden and the notice only fades, and the window still runs.