Vivid API

Side Drawer

A side panel that slides in from the edge of the screen to display additional content or navigation options.

Usage

import { registerSideDrawer } from '@vonage/vivid-api';
registerSideDrawer('your-prefix');

Slots

Default

Use the default slot to add content to the side drawer itself.

App Content

Use the app-content slot for the main application content, the side drawer is opened next to.

CSS Parts

Base

Use the CSS part base to provide custom styling to the Side-Drawer.

CSS Variables

Application Content Offset

Use --side-drawer-app-content-offset to set a value different from 280px to the offset of side drawer’s application content.
This is needed if a custom width is set on the side-drawer, or if side-drawer needs to overlap content see use-case

API Reference

Properties

PropertyTypeDefaultDescription
alternatebooleanapplies scheme alternate region
modalbooleansets the side drawer's type to modal
openbooleanindicates whether the side drawer is open
trailingbooleansets the side of the side drawer
PropertyTypeDefaultDescription
alternatebooleanapplies scheme alternate region
modalbooleansets the side drawer's type to modal
openbooleanindicates whether the side drawer is open
trailingbooleansets the side of the side drawer

Slots

NameDescription
app-contentSets assigned nodes to the main application content, the side drawer is opened next to.
defaultSets assigned nodes to the side drawer itself.
NameDescription
app-contentSets assigned nodes to the main application content, the side drawer is opened next to.
defaultSets assigned nodes to the side drawer itself.

Events

NameTypeDescription
cancelCustomEvent<undefined>Fired when the user requests to close the side-drawer. You can prevent the side drawer from closing by calling `.preventDefault()` on the event.
closeCustomEvent<undefined>Fired when the side drawer is closed.
openCustomEvent<undefined>Fired when the side drawer is opened.
NameTypeDescription
cancelCustomEvent<undefined>Fired when the user requests to close the side-drawer. You can prevent the side drawer from closing by calling `.preventDefault()` on the event.
closeCustomEvent<undefined>Fired when the side drawer is closed.
openCustomEvent<undefined>Fired when the side drawer is opened.