Skip to content

Drawer ​

A panel that slides in from the edge of the screen over the page.

Filters

September orders

Status
Delivery

For an app menu that stays on screen, use a Sidebar.

Installation ​

ts
import { NuiDrawer } from '@numior/kit';

Usage ​

Open the drawer and change its side, size and the ways to close it.

Order 20403

Tim Sayed, Denver

  • 1 × Malmo desk
  • 2 × Bergen chair

Screen edge: start, end, top or bottom. start and end swap in right-to-left layouts.

size
Width of a side drawer or maximum height of a top or bottom one, from sm to xl. xl suits an editor beside the page.

Title. Screen readers announce it on open.

Description under the title.

Examples ​

Build a form in a drawer ​

Put the buttons into the footer slot.

New customer

The card appears in the customer list

The footer sits outside your <form>, so link the submit button to the form with the form attribute.

Accessibility ​

The drawer is a Dialog at the edge of the screen. The focus, Esc, the screen reader announcements and the close event work the same way.

Keys
Action
Esc
Closes the top dialog when closable is on.
⇥
Moves the focus through the dialog. The page behind it cannot be reached.

API ​

Props

Name
Type
Default
Description
side
NuiDrawerSide
"end"
Screen edge: start, end, top or bottom. start and end swap in right-to-left layouts.
size
NuiDrawerSize
"md"
Width of a side drawer or maximum height of a top or bottom one, from sm to xl. xl suits an editor beside the page.
title
string
—
Title. Screen readers announce it on open.
id
string
—
The id attribute of the drawer. Generated when omitted.
description
string
—
Description under the title.
closeLabel
string
—
Close button label for screen readers. Defaults to "Close" from the dictionary.
closable
boolean
true
Shows a close button and lets Esc and a backdrop click close the drawer.
closeOnBackdrop
boolean
true
Closes on a click on the dimmed backdrop.

Models

Name
Type
Default
Description
v-model:open
boolean
false
Whether the drawer is open.

Events

Name
Payload
Description
close
[returnValue: string]
Fires on close with the returnValue of a method="dialog" form.

Slots

Name
Slot props
Description
title
any
Custom title instead of title.
description
any
Custom description instead of description.
default
any
Drawer content.
footer
any
Buttons at the bottom of the drawer. A button in a method="dialog" form closes it without code.

Edit this page

Search

Esc