Collapsible
display
Collapsible: a toggleable section with title and body
Terminal
$termuijs render collapsible
Installation
$ bunx termuijs add collapsible
Copies the source into src/components/collapsible/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Collapsible } from '@termuijs/widgets'ts
new Collapsible(title: string, body: string, style: Partial<Style> = {}, opts: CollapsibleOptions = {},)API Reference
Collapsible
| Prop | Type | Required | Description |
|---|---|---|---|
title | string | required | — |
body | string | required | — |
open | boolean | optional | Start open |
expandChar | string | optional | Expand indicator char |
collapseChar | string | optional | Collapse indicator char |
onToggle | (open: boolean) => void | optional | Callback when toggled |