Skip to content
Sign upGet access
MicrointeractionsBudget brakeMenu

Budget brake (Pro)

ProIncluded in $99

A budget that stops the agent: the bar hits the cap like a wall and a lock drops on.

ProThe bar fills as the run spends and turns amber near the cap; at the cap it runs into the end, a lock drops on and the run pauses.

The bar fills as the run spends and turns amber in its last fifth. When it reaches the cap it runs into the end like a wall: the fill gives a little and settles, a lock drops onto the end of the track, and the line says the run is paused with what you can do next.

Installation

$ pnpm dlx shadcn@latest add @chatcn-pro/budget-brake

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 { BudgetBrake } from "@/components/ui/chatcn/pro/budget-brake"

<BudgetBrake spent={run.spent} budget={20} onRaise={raise} onStop={stop} />

Examples

Levels

ProThe same budget at a third spent, close to the limit, and at the limit with the brake on.

Props

PropTypeNotes
spent / budgetnumberReaching the budget pauses
currencystringDefault "USD"
scopestringDefault "this run"
onRaise / raiseLabel() => void / stringDefault label doubles the cap
onStop() => voidShows End run

Accessibility

  • The title is a status that changes to Paused at the budget; the bar is a labelled meter.

Motion

  • The fill is a heavy spring; the hit is a 380 ms press; the lock drops 420 ms. Reduced motion: the bar jumps.