Collapsible

One section behind a key that shows and hides it.

Component

Collapsible belongs to the Layout group in the CyberSpec catalog. It uses @ui-sdk/react/collapsible.

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

Example

"use client"

import { Collapsible } from "@/components/ui/collapsible"

export default function CollapsibleDemo() {
  return (
    <>
      <Collapsible label="Black-box log" summary="3 entries" defaultOpen>
        <p>02:14 Link opened from Lowtide.</p>
        <p>02:19 Trace answered with Null Ping.</p>
        <p>02:31 Link closed. Nothing followed it home.</p>
      </Collapsible>
      <Collapsible label="Sealed evidence" summary="Locked" disabled>
        Held by Solace Mutual until the claim is settled.
      </Collapsible>
    </>
  )
}

Install this example

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

Resources

View as Markdown