Drawer
uitemplate
Drawer: a side panel that slides in from any edge
Terminal
$termuijs render drawer
Installation
$ bunx termuijs add drawer
Copies the source into src/components/drawer/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Drawer } from '@termuijs/ui'ts
new Drawer(options: DrawerOptions)API Reference
Drawer
| Prop | Type | Required | Description |
|---|---|---|---|
position | DrawerPosition | required | Edge the drawer appears from |
width | number | optional | Panel width in columns |
height | number | optional | Panel height in rows |
title | string | optional | Optional title shown in the drawer's top border |
onClose | () => void | required | Called when the user presses Escape or explicitly closes the drawer |
backdropChar | string | optional | Character used for the dimmed backdrop |
borderColor | Style['fg'] | optional | Border colour |