Loading component…
Loading component…
When an agent may run, as a block on a time ruler with its pixel mark and a thin line for now – drag the window or its grips to move it
To reuse this local React demo, copy all files from the Code tab into the same folder, then import RunWindow from ./run-window.
import { RunWindow } from "@/components/ui/run-window";
const [win, setWin] = useState<[number, number]>([9 * 60, 10 * 60]);
<RunWindow
title="Nightly reindex"
range={[8 * 60 + 30, 11 * 60 + 30]}
start={win[0]}
end={win[1]}
now={minutesSinceMidnight}
onChange={(start, end) => setWin([start, end])}
agent={{ id: "indexer", name: "Indexer" }}
label="Reindex search"
/>| Name | Type | Default | Description |
|---|---|---|---|
| range | [number, number] | The ruler, in minutes from midnight – e.g. [510, 690] for 08:30 to 11:30 | |
| start / end | number | The window, in minutes from midnight; kept inside the ruler and at least two steps long | |
| now | number | Now, in minutes – a thin line; before the window it says when it starts, inside it the part behind now is strong | |
| onChange | (start, end) => void | Makes the window movable – drag it, drag its grips, or use the arrow keys | |
| step | number | 5 | What the window snaps to, in minutes |
| agent | { id: string; name: string } | The agent that runs in it – its pixel mark and name sit in the window | |
| label | string | "Run" | What runs – under the ruler, with the window's length |
| title | string | "Run Window" | Heading on the frame |
| icon | ReactNode | A small mark before the title – defaults to a calendar, in red | |
| actionLabel / onAction | string / () => void | "Open" | The button on the top right – it shows when onAction is given |
| className | string | Extra class on the root |
Built on a container query; under 420px the agent's name and the ruler's own times step aside – the card keeps the same size as every agent chart card
The ruler's own times step aside when the window's are close to them
Dark mode built in: switches when an ancestor (usually <html>) has the class dark or data-theme="dark"