Nasaq
Components

KillSwitch

One control that stops every automation with a required reason, plus a banner that shows the paused state and a list of paired browsers to unpair.

PreviewOpen ↗

Code

{paused ? <PausedBanner paused={paused} onResume={resume} /> : null}<KillSwitch paused={paused} activeCount={14} onStopAll={stop} onResume={resume} browsers={browsers} onUnpairBrowser={unpair} />

Workflow · beta

Live examples and controls: KillSwitch in the lab.

Install

npx shadcn@latest add https://docs.nasaqui.com/r/kill-switch.json

The big red button for automations, and the banner that keeps everyone aware while it is pressed.

When to use

  • Operators need to stop every running automation or agent at once.
  • A paused state must stay visible on every screen (PausedBanner).

When not to use

  • Pausing one workflow: use its own toggle.
  • Ending a session: use ImpersonationBanner.

Import

import { KillSwitch, PausedBanner } from "@fadymondy/nasaq/web";

Quick start

{paused ? <PausedBanner paused={paused} onResume={resume} /> : null}
<KillSwitch paused={paused} activeCount={14} onStopAll={stop} onResume={resume} browsers={browsers} onUnpairBrowser={unpair} />

Anatomy

KillSwitch           data-slot="kill-switch"
├─ status card       running count or paused info (who, when, why)
├─ Stop all          opens a dialog that requires a reason
├─ Resume            confirm, errors shown inline
└─ paired browsers   rows with online dot, unpair via AlertDialog; context menu on each row
PausedBanner         role="status", sticky

API

PropTypeDefaultDescription
pausedPauseInfo | nullrequired{ by, at, reason } while paused.
activeCountnumberrequiredAutomations running now.
onStopAll(reason) => Promise<void | { error? }>requiredStops everything.
onResume() => Promise<...>requiredResumes.
browsersPairedBrowser[]nonePaired browsers. The current one cannot be unpaired.
onUnpairBrowser(id) => Promise<...>noneUnpair one browser.
labelsKillSwitchLabelsen / arEvery string.

PausedBanner takes paused, onResume?, sticky (default true), hint, labels.

Examples

  • Banner only: render PausedBanner in the app shell whenever paused is set.

Accessibility

Destructive actions go through dialogs; the reason field is required and labelled. The banner is a status region. Online state has a text label as well as the dot.

RTL & i18n

English and Arabic built in. Times use DateTime; browser names are shown as text, not as vendor logos.

Styling & tokens

--nq-danger-* while running (the stop button) and --nq-warning-* while paused.

Do / Don't

  • Do keep the banner visible on every page while paused.
  • Do not allow a stop without a reason: the audit trail needs it.

Lab

https://docs.nasaqui.com/?path=/docs/components-workflow-kill-switch--docs

On this page