Toast preview

Interactive preview of the CyberSpec Toast component. Keys that raise a notification in each tone.

About this preview

Toast belongs to the Overlays group in the CyberSpec catalog. It uses @ui-sdk/react/toast.

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/toast.json

Example

"use client"

import { ToastKeys } from "@/components/ui/toast"
import { Toasts } from "@/components/ui/toaster"

export default function ToastDemo() {
  return (
    <>
      <ToastKeys />
      {/* An app mounts this once, at its root. Only the first one mounted
          shows toasts, so this one stands down wherever the page already
          has its own. */}
      <Toasts />
    </>
  )
}

Install this example

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

Resources

View as Markdown