# Collapsible

One section behind a key that shows and hides it.

[View Collapsible on CyberSpec](https://www.cyberspec.dev/components/sidebar/collapsible)

## 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.

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

## Example

```tsx
"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

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

## Resources

- [Interactive Collapsible preview](https://www.cyberspec.dev/preview/collapsible)
- [Component catalog](https://www.cyberspec.dev/components.md)
- [Collapsible source code](https://github.com/agnelnieves/cyberspec/blob/main/registry/cyber/ui/collapsible.tsx)
- [Shadcn registry item](https://www.cyberspec.dev/r/collapsible.json)
