Collapsible
One region that opens and closes on the disclosure spring.
Features
- One region on the reflow spring.
Use it for
- Optional details.
Installation
- Get runets.
git clone https://github.com/ziyam-khan/runets - Copy these files into your project, keeping their folders.
- Install what they use.
pnpm add react @base-ui/react motion lucide-react - Load the styles once. Bring your own base tokens, or use runets’ default theme.
import 'runets/styles/theme.css' import 'runets/styles/kit.css'
Usage
import { Collapsible } from 'runets'
<Collapsible title="Show the details">…</Collapsible>API
| Prop | Type | What it does |
|---|---|---|
title | string | Trigger text. |
Accessibility
- aria-expanded on the trigger.
Source
The code is in src/kit/surfaces.tsx in runets, MIT licensed.