Skip to content

Drawer

uitemplate

Drawer: a side panel that slides in from any edge

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

PropTypeRequiredDescription
positionDrawerPositionrequiredEdge the drawer appears from
widthnumberoptionalPanel width in columns
heightnumberoptionalPanel height in rows
titlestringoptionalOptional title shown in the drawer's top border
onClose() => voidrequiredCalled when the user presses Escape or explicitly closes the drawer
backdropCharstringoptionalCharacter used for the dimmed backdrop
borderColorStyle['fg']optionalBorder colour
#template#drawer