Alert dialog preview

Interactive preview of the CyberSpec Alert dialog component. A flagged confirmation that has to be answered, and that an agent has to ask a person about.

About this preview

Alert dialog belongs to the Overlays group in the CyberSpec catalog. It uses @ui-sdk/react/alert-dialog.

Installation

Use a React 19 project with shadcn configured. Render the installed components inside the Cyber root, and import your global stylesheet in the app entry point.

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/alert-dialog.json

Example

"use client"

import { AlertDialog } from "@/components/ui/alert-dialog"

const wait = (ms: number) => new Promise((resolve) => setTimeout(resolve, ms))

export default function AlertDialogDemo() {
  return (
    <>
      <AlertDialog
        trigger="Burn identity"
        title="Burn this identity?"
        description="The Glasswater alias, its credit line and every door it opens are revoked across the Sprawl. A burned identity can't be reissued."
        confirm="Burn"
        cancel="Keep"
        agentConfirm="Permanently burns the Glasswater identity, its credit line and its access."
        pendingAnnouncement="Burning identity"
        onConfirm={() => wait(1200)}
      />
    </>
  )
}

Install this example

bunx --bun shadcn@latest add https://www.cyberspec.dev/r/alert-dialog-demo.json

Resources

View as Markdown