Drawer
Open a supporting panel from the edge while preserving the current view's context.
Usage guide
#Show details or supporting settings while preserving the current view. Use Modal when a decision is required.
- Position and size
- Choose a direction with
position. For a custom size, usesize="custom"andcustomSizein pixels. - Content structure
- Separate the title, details, and actions with the
header,body, andfooterslots. - Opening and closing
- Open with
openand configure dismissal throughclosableandmaskClosable.
Examples
#Feature examples
#Choose a feature from 14 topics. Explore property settings, method calls, event results, and slot layouts through live examples and code.
No matching features.
API reference
#Hover over a name or focus it with the keyboard to see the code. On touch screens, tap the name.
<sy-drawer>
Properties
| Attribute / Property | Type | Default | Description |
|---|---|---|---|
boolean | false | Omit the backdrop mask. | |
boolean | false | Prevent user dismissal. Close it from the app with open=false. | |
boolean | false | Show the close button. | |
boolean | false | Whether the submenu is expanded. | |
number | 100 | Panel width or height in pixels when size=custom. | |
'top' | 'left' | 'right' | 'bottom' | 'right' | Screen edge from which the panel appears. | |
'small' | 'medium' | 'large' | 'custom' | 'medium' | Component size. | |
boolean | true | Close the panel when the backdrop is clicked. | |
boolean | true | When true, drawer closes on browser history navigation. Spec default: true. | |
string | '' | id of the parent element that contains the panel. | |
| 'none'
| 'fade' | 'fade-scale' | 'zoom' | 'pop'
| 'slide' | 'slide-fade' | 'reveal'
| 'slide-top' | 'slide-bottom' | 'slide-left' | 'slide-right'
| 'slide-fade-top' | 'slide-fade-bottom' | 'slide-fade-left' | 'slide-fade-right'
| 'reveal-top' | 'reveal-bottom' | 'reveal-left' | 'reveal-right'
| 'flip-x' | 'flip-y' | 'bounce' | 'spin' | 'none' | Enter/exit animation type. `none` (default) toggles instantly. Three flavors of direction handling: - **Auto** (`slide`, `slide-fade`, `reveal`): direction follows the `position` attribute (a right-anchored drawer slides from the right). - **Explicit** (`slide-{top,bottom,left,right}`, `slide-fade-…`, `reveal-…`): direction is fixed regardless of `position`. - **Direction-less**: plays the same way no matter the orientation. Some combinations (e.g. `zoom` on an edge-anchored panel) look unusual but are exposed for completeness — selection is the consumer's call. | |
'x-fast' | 'fast' | 'medium' | 'slow' | 'x-slow' | 'fast' | Animation playback speed token. Maps to `--transition-*` global tokens. |
Events
| Event | Detail | Description |
|---|---|---|
CustomEvent<void> | Emitted when the list opens. | |
CustomEvent<void> | Read the result from the event's detail. |
Slots
| Slot | Description |
|---|---|
| Content displayed in the header area. | |
| Content displayed in the body area. | |
| Content displayed in the footer area. |