On this page
@addTagHelper *, Webority.Ui.RazorOpen from a button
The footer stays pinned while the body scrolls, so the action is always in reach.
Snap points
On a phone the sheet rests at each point, as a percentage of the screen height.
Side and size
Choose the edge the panel slides from, and a preset width for its size.
A side panel on every screen
Set sheet to false to keep a menu or filter panel at the side on a phone too.
Forced choice
Use a static backdrop when the drawer must not close on a backdrop click, Escape or a drag down.
Ask before discarding edits
Ask before closing a form that has unsaved changes, so an edit is not thrown away by mistake.
Custom header
Replace the default header with your own markup when the panel needs a heading of its own.
Every option
Every value of every prop, one cell each.
id
id="mx-id"open
open="false" (default)onClose
onClose: React callback; Razor listens for wui-drawer-closetitle
title="Filters"titleIcon
title-icon="filter"header
<app-drawer-header>subtitle
subtitle="3 applied"ariaLabel
aria-label="Filters"width
width="420px"maxWidth
max-width="600px"sheet
sheet="true" (default)sheet="false"closeLabel
close-label="Dismiss"sheetHeightLabel
sheet-height-label="Height"headerClassName
header-class-name="fw-bold"bodyClassName
body-class-name="p-0"side
side="end" (default)side="start"size
size="sm"size="md" (default)size="lg"size="xl"snapPoints
snap-points="50,90" (default)snap-points="30,60,95"snap-points="40"snap-points="100"defaultSnap
default-snap="0" (default)default-snap="1"onSnapChange
onSnapChange: React callback; Razor listens for wui-drawer-snaponOpened
onOpened: React callback; Razor listens for wui-drawer-openedonClosed
onClosed: React callback; Razor listens for wui-drawer-closeddismissible
dismissible="true" (default)dismissible="false"staticBackdrop
static-backdrop="true" (default)static-backdrop="false"confirmDiscard
confirm-discard="Discard your changes?"dirty
dirty: React prop; Razor asks once a field in the drawer changesfooter
no footer (default)<app-drawer-footer>className
class: React className; a plain class attribute on app-drawerstyle
style: React style; a plain style attribute on app-drawerGuidance
What to do, and what to avoid.
Use it when
- A filter, detail or edit panel that must not squeeze the page on a phone.
- A menu or filter panel that stays a side panel on a phone (sheet false).
- Secondary content the user opens, reads or edits, then dismisses.
Reach for something else when
- A short confirmation or a form that needs the user's full attention. → AppModal
- Content that belongs beside a list. → AppSplitView
Reference
Try every prop, read the full list, and check keyboard and screen reader behaviour.
21 props. The 5 most used come first.
Used on most screens 5 props
| Prop | Type | Default | Description |
|---|---|---|---|
| titledefault - | string | - | The heading, and the dialog's accessible name. |
| sidedefault end | end | start | end | Which edge the side drawer slides from. |
| opendefault false | bool | false | Whether the drawer is open. The caller owns it and closes it in onClose. |
| widthdefault - | string | - | The panel's CSS width, such as 420px. Overrides size. |
| sheetdefault true | bool | true | Below md the drawer is a bottom sheet that rests on snapPoints. false keeps the side panel at every width, for a menu or a filter panel. |
Less common 16 props
| Prop | Type | Default | Description |
|---|---|---|---|
| iddefault required | string | required | The id a data-wui-open="#id" trigger names. |
| subtitledefault - | string | - | A line under the title. |
| aria-labeldefault - | string | - | The dialog's accessible name when there is no title. |
| sizedefault md | sm | md | lg | xl | md | The side drawer's width: 360, 480, 640 or 720 px. |
| snap-pointsdefault 50,90 | string | 50,90 | The sheet's resting heights as a comma list, each 10 to 100 percent of the screen height. |
| default-snapdefault 0 | int | 0 | Which of the sorted snap points it opens on. |
| dismissibledefault true | bool | true | Show the close button. |
| static-backdropdefault true | bool | true | The backdrop, Escape and a drag down leave it open; only the close button or open closes it. Set false to let them close it. |
| confirm-discarddefault - | string | - | Ask before closing while dirty: this text, with Discard and Keep editing in the footer. |
| title-icondefault - | string | - | Library icon beside the title. |
| max-widthdefault 92vw | string | 92vw | Caps the panel's width, such as 600px. Unset, the theme caps it at 92vw. |
| close-labeldefault Close | string | Close | The close button's accessible name, for other languages. |
| sheet-height-labeldefault Sheet height | string | Sheet height | The sheet handle's accessible name, for other languages. |
| header-class-namedefault '' | string | '' | Classes on the default header, so a product can style it without restyling the library class. Ignored when header replaces it. |
| body-class-namedefault '' | string | '' | Classes on the scrolling body, such as p-0 to drop its padding. |
| app-drawer-headerdefault - | element | - | A child that replaces the default title, subtitle and close button. |
Screen reader
3 notes- The panel is a native dialog, named by ariaLabel, else by the title.
- The sheet handle is a vertical slider labelled Sheet height, and the close button is labelled Close.
- Focus moves in on open, Tab moves through the drawer, then on to the browser, without wrapping, Escape leaves it open unless staticBackdrop is false, and focus returns to what opened it.