Founding price: $35, then $99 after 23:59 UTC on 4 November, then $99
Get ProA switch where turning it on opens a confirmation and turning it off is immediate, so the visible state never gets ahead of what the person agreed to.
Derived from this item’s props table, because it declares no controls of its own. This item has no standalone playground, so changes update the code, the share link and the AI prompt.
Use this for settings with a downside when enabled: public sharing, auto-deleting data, bypassing review, sending real emails. Turning it back off is always cheap, so only the "on" direction asks.
Do not use it for harmless preferences. A dialog on every switch teaches people to click through them.
This item is part of tealmac UI Pro
The source for this item installs with a Pro licence key. Log in with your key to see the install command, or read the Pro setup page.
| Prop | Type | Default | Description |
|---|---|---|---|
label, description | string | - | Visible text beside the switch. |
checked / onCheckedChange | boolean / fn | - | Controlled state. onCheckedChange(true) is called only after the dialog is accepted. |
confirmTitle, confirmDescription | string | - | Dialog text. |
confirmLabel | string | Turn on | Label of the accept button. |
aria-describedby for the description, so the risk is read before the state.aria-checked never reports a state that was not confirmed.| Key | Action |
|---|---|
| Space | toggles the switch (opens the dialog when turning on) |
| Escape | closes the dialog and keeps the switch off |
The pattern ships a Testing Library test (confirm-risky-toggle.test.tsx) that covers asking before turning on, declining, turning off at once, the description and keyboard use.