Skip to content

Slide to Run

A deliberate commit for an agent run that is costly to undo. Slide the knob to the end, or hold; it follows your hand, gives like a rubber band past the end, and the release decides by how far and how fast you went. A run fills the track into a Ran pill; a refusal shakes and springs back with its reason.

On this page
Used for
  • Commit a costly agent run
  • Touch-first approvals
  • Bulk sends and deploys
  • Payments an agent prepared

Examples

Mode

Installation

Installation is part of Pro

Pro components install from a licensed registry. The live preview stays open to everyone.

Props

childrenrequired
ReactNode
The words on the track, e.g. Slide to send 1,240 emails. Also the knob's name when it is a string.
onRunrequired
() => unknown
Runs once the slide or hold commits. Return false or a reason string to refuse; throwing refuses too. The knob waits at the end while a promise runs.
mode
"slide" | "hold"
Default"slide"
Drag the knob, or press and hold anywhere on the track while the knob moves with the clock.
holdMs
number
Default1200
How long a hold takes (the hold mode, and Space or Enter always).
doneLabel / busyLabel
ReactNode
Default"Ran" / "Running..."
The pill once it ran, and the track while onRun works.
tone
"primary" | "danger"
Default"primary"
The accent, or red for something destructive. The done pill is a calm status tint with its ink in both.
releaseLabel
ReactNode
Default"Release to run"
Takes the label's place near the end of the track, so the bar never reads blank.
Release
-
Runs past 90% of the track, or past half of it at more than 600px a second. A move under 6px is a tap and shows the hint. The speed is read from the last 80ms only, 0 if the hand was still, and capped at 3000px a second.
Motion
-
1:1 under the hand; past the ends the knob stays in the track and stretches toward the pull, 7px at most (k·tanh); home on SPRING.glide carrying the hand's speed; a stretch of up to 15% while it moves; the check pops with usePlay confirm. Reduced motion: it lands where the release decided, at once.

Accessibility

  • The knob is a slider with its value in percent; holding Space or Enter runs it, and letting go early, or moving focus away, sends it back.
  • The hint under the track says how to use it and is the knob's description; a refusal replaces it with the reason.
  • Running and Ran are given as the slider's value text, so a screen reader hears the outcome.

What it handles

  1. 01Follows the hand 1:1 and, past either end, stretches the knob a few px toward the pull inside the track instead of a hard stop.
  2. 02Decides at release: past 90% of the track, or past half of it at more than 600px a second, runs; a move under 6px is a tap.
  3. 03Reads the hand's speed from its last 80ms only, drops it after a still hand and caps it, then carries it into the spring home.
  4. 04Moves with the clock while Space or Enter is held, or a press in the hold mode, and goes back if let go early.
  5. 05Waits at the end with a spinner while onRun works, then fills the track into the done pill with a check.
  6. 06Refuses on false or a reason string: one shake, the reason under the track, and the knob home.

States

First render
Nothing
none
Dragging
The knob follows the hand and stretches with speed
none fixed: a spring (glide) that settles
Let go short
The knob springs home with the hand's speed
none fixed: a spring (glide) that settles
Ran
The track fills into the pill and the check pops
420ms, ease out
Refused
One shake of the track
280ms, ease out
Reduced motion
Lands where the release decided, at once
0ms

Works with

When to use

When to use

  • Committing an agent run that is costly to undo (a bulk send, a deploy, a payment) with a gesture that cannot happen by accident.
  • Touch-first approvals where a hold or a slide reads better than a confirm dialog.

When not to use

  • A destructive button in a form or a settings page: use Hold Button.
  • Approving a single tool call with its arguments: use Approval Prompt.

Using with AI

Use Copy page for AI above to give your assistant this page, Copy prompt under the install command to have it installed and wired to your data, or connect the Knowns UI MCP server and just ask:

  • Add the Knowns UI Slide to Run to my app and wire it to my own data.
  • I need committing an agent run that is costly to undo (a bulk send, a deploy, a payment) with a gesture that cannot happen by accident. Set that up with the Knowns UI Slide to Run.
  • Which Slide to Run props do I need for a minimal setup? Show me a short example.

With the server connected, your assistant calls get_component({ name: "slide-to-run" }) and search_docs({ query: "slide to run" }). Pro props, full examples and source come back once your license key is in the MCP config.

Need help?

Stuck on Slide to Run, or found something off? We read every message.