Overlays

Drawer

@xui/drawer

A panel that slides in from an edge. Same modal overlay as the dialog, pinned to a side and sized on its sliding axis, with a Web-Animations slide-in. Position, animation and focus are not testable in jsdom — verify here.

Install

pnpm add @xui/drawer

Add the barrel to a standalone component's imports:

import { XuiDrawerImports } from '@xui/drawer';

@Component({
  imports: [XuiDrawerImports],
  // …
})

Examples

Positions

Loading preview…

With footer

Loading preview…

API

XuiDrawer

componentxui-drawer

A panel that slides in from an edge of the screen.

Inputs

NameTypeDefaultclassClassValueThe user-defined classes on the surface. Merged last so they win.''titlestring | nullThe drawer's heading, also used as its accessible name.nullpositionXuiDrawerPositionWhich edge the drawer slides in from. Also decides whether size is read as a width or a height.this.config.positionsizeXuiDrawerSizeHow far the drawer extends from its edge — a width for left/right, a height for top/bottom.this.config.sizecanEscapeKeyClosebooleanLet Escape close the drawer.this.config.canEscapeKeyClosecanOutsideClickClosebooleanLet a click on the backdrop close the drawer.this.config.canOutsideClickCloseshowCloseButtonbooleanShow the × in the header.this.config.showCloseButtonopentwo-waybooleanWhether the drawer is showing. Two-way bindable with [(open)].false

Methods

show(): voidclose(): void

Source

libs/ui/drawer/xui

xUI 2.0.0 — Apache 2.0 licensed. Built with Angular and Tailwind CSS.