Componentfeedback0.81 KB gzipZero dependencies
Danger Zone
Red-framed destructive actions area with two-step confirm.
Preview
Live Preview
Installation
Tokens guide →Add to your project via CLI (zero dependencies, code you own):
npx bigbullui add danger-zoneOr install the full npm package:
npm install bigbulluiUsage
tsx3 lines
import { DangerZone } from "@/components/ui/danger-zone"; <DangerZone />Source code
danger-zone.tsx + 1 helperZero third-party dependencies (2 local files shown in tabs below).
tsxdanger-zone.tsx45 lines
"use client"; import * as React from "react";import { cn } from "./lib/utils"; export interface DangerZoneProps extends React.HTMLAttributes<HTMLDivElement> { title?: string; actions: { id: string; label: string; description?: string; onConfirm?: () => void }[];} /** Danger zone with red border: two-step confirmation. */export function DangerZone({ title = "Danger Zone", actions = [], className, ...props }: DangerZoneProps) { const [confirming, setConfirming] = React.useState<string | null>(null); return ( <div className={cn("w-full max-w-md rounded-lg border-2 border-destructive/40 p-4", className)} {...props}> <h3 className="font-mono text-[10px] font-bold uppercase tracking-[0.15em] text-destructive">{title}</h3> <ul className="mt-3 space-y-2.5">Props
Interactive Prop Playground
Tweak parsed AST props below to generate ready-to-paste JSX.
tsx3 lines
import { DangerZone } from "@/components/ui/danger-zone"; <DangerZone />| Prop | Type | Description |
|---|---|---|
| title | string | Primary heading or title text. (Default: "Danger Zone") |
| actions | { id: string; label: string; description?: string; onConfirm?: () => void }[] | Configures actions. (Default: []) |