Fold
Under the fold
A native disclosure. The law is one sentence.
The law
A poster you can install.
Shows or hides one section with a native details disclosure.
Under the fold
A native disclosure. The law is one sentence.
Three ways in. They share one source, so the pixels match whichever you pick.
npm install @noorddev/vlak-react
// once, next to your app's root
import "@noorddev/vlak-react/css";
import { Collapsible } from "@noorddev/vlak-react";Precompiled React and one stylesheet. No compiler to configure. Per-component imports work too: @noorddev/vlak-react/components/collapsible.
npx @noorddev/vlak-cli add collapsible
The StyleX leaf lands in components/vlak/ with its dependencies, for your own compiler to own. See StyleX.
npx shadcn add https://vlak.dev/r/collapsible.json
The same registry item, installed by shadcn's CLI.
<link rel="stylesheet" href="node_modules/@noorddev/vlak/css/vlak.css" />
No React. Link vlak.css and use the markup and classes below.
import { Collapsible } from "@noorddev/vlak-react";
<Collapsible title="Show the details">Here they are.</Collapsible>
<Collapsible title="Advanced" open={open} onToggle={(e) => setOpen(e.currentTarget.open)}>…</Collapsible>A bare native <details>.
| Prop | Type | Default | Description |
|---|---|---|---|
titlerequired | ReactNode | ||
defaultOpen | boolean |
Also accepts Omit<DetailsHTMLAttributes<HTMLDetailsElement>, "title">.
| Keys | Does |
|---|---|
| Tab | Moves focus to the summary |
| Enter, Space | Opens or closes it |
<details class="rs-disclosure"><summary>Show the details<svg class="rs-acc-chevron" viewBox="0 0 16 16" width="16" height="16" fill="none" stroke="currentColor" stroke-width="1" stroke-linecap="butt" stroke-linejoin="miter"><g transform="rotate(90 8 8)"><path d="M5.5 3.5 L10.5 8 L5.5 12.5" vector-effect="non-scaling-stroke"/></g></svg></summary><div class="rs-disclosure-body">Here they are.</div></details>