# Dialog preview

Interactive preview of the CyberSpec Dialog component. A modal panel on a spined frame that tears in over a dimmed page, with its answers on keys below.

[View Dialog preview on CyberSpec](https://www.cyberspec.dev/preview/dialog)

## About this preview

Dialog belongs to the Overlays group in the CyberSpec catalog. It uses @ui-sdk/react/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.

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

## Example

```tsx
"use client"

import { Dialog } from "@/components/ui/dialog"

export default function DialogDemo() {
  return (
    <>
      <Dialog
        trigger="Wipe deck"
        title="Wipe this deck and return it to factory firmware?"
        description="Installed daemons, saved routes and seven unassigned upgrade points are erased. This can't be undone from the field."
        confirm="Wipe"
        cancel="Back"
      />
    </>
  )
}
```

## Install this example

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

## Resources

- [Dialog documentation](https://www.cyberspec.dev/components/sidebar/dialog.md)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Dialog source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/dialog.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/dialog.json)
