Drawer
A sheet that glitches in and out at the edge of the page. Drag it toward that edge to dismiss it.
Component
Drawer belongs to the Overlays group in the CyberSpec catalog. It uses @ui-sdk/react/drawer.
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/drawer.json
Example
"use client"
import { Drawer } from "@/components/ui/drawer"
const log = [
["22:41:07", "Handshake accepted by NODE 3F:A2."],
["22:41:09", "Ghostwrite loaded. Tracer masked."],
["22:43:30", "Vanta relay dropped two packets. Resent."],
["22:47:12", "Patrol sweep over Cinder Row. Link held."],
["22:52:48", "Route to Glasswater cleared."],
["22:53:01", "Link stable."],
]
export default function DrawerDemo() {
return (
<>
<Drawer trigger="Signal log" title="Signal log" description="The last six events on this link, oldest first.">
<ol>
{log.map(([at, line]) => (
<li key={at}>
<time>{at}</time>
<span>{line}</span>
</li>
))}
</ol>
</Drawer>
</>
)
}
Install this example
bunx --bun shadcn@latest add https://www.cyberspec.dev/r/drawer-demo.json