A panel that slides in from the edge of the screen and can be dismissed by dragging or interacting with a control.
Loading...
Installation
Install the following dependencies:
Copy and paste the following code into your project.
Loading...
Update the import paths to match your project setup.
Composition
<app-drawer> ├── [appDrawerTrigger] └── <app-drawer-content> ├── <app-drawer-handle> (optional) ├── [appDrawerHeader] │ ├── [appDrawerTitle] │ └── [appDrawerDescription] ├── [appDrawerBody] ├── [appDrawerFooter] (optional) └── [appDrawerClose] (optional)
Examples
Account
Loading...
Automation
Loading...
Default
Loading...
Meetings
Loading...
Notifications
Loading...
Sprint
Loading...
Step Goal
Loading...
API Reference
<app-drawer>
Inputs
| Input | Type | Default | Description |
|---|---|---|---|
id | string | undefined | generated | Unique identifier used to connect the drawer parts. |
ids | Partial<DrawerElementIds> | undefined | — | Overrides generated identifiers for individual parts. |
open | boolean | undefined | — | Open state when controlled. Supports Angular two-way binding. |
defaultOpen | boolean | false | Initial open state when uncontrolled. |
modal | boolean | true | Enables modal behavior. |
closeOnInteractOutside | boolean | true | Closes the drawer after an allowed outside interaction. |
closeOnEscape | boolean | true | Closes the drawer when Escape is pressed. |
preventScroll | boolean | true | Prevents document scrolling while the drawer is open. |
trapFocus | boolean | true | Keeps keyboard focus inside the open drawer. |
restoreFocus | boolean | true | Restores focus after the drawer closes. |
initialFocusEl | (() => HTMLElement | null | false) | undefined | — | Returns the element that should receive initial focus. |
finalFocusEl | (() => HTMLElement | null) | undefined | — | Returns the element that should receive focus after closing. |
role | "dialog" | "alertdialog" | undefined | "dialog" | Sets the drawer's accessible role. |
triggerValue | string | null | undefined | — | Active trigger value when controlled. Supports Angular two-way binding. |
defaultTriggerValue | string | null | undefined | — | Initial active trigger value when uncontrolled. |
snapPoints | DrawerSnapPoint[] | undefined | [1] | Snap points expressed as viewport ratios or CSS length strings. |
swipeDirection | DrawerSwipeDirection | undefined | "down" | Edge toward which the drawer closes when swiped. |
snapToSequentialPoints | boolean | false | Moves through adjacent snap points instead of skipping between them. |
swipeVelocityThreshold | number | undefined | 500 | Release velocity that opens the drawer, in pixels per second. |
closeThreshold | number | undefined | 0.5 | Drag progress required to close the drawer. |
preventDragOnScroll | boolean | true | Prevents a drawer drag from taking over an active scroll gesture. |
snapPoint | DrawerSnapPoint | null | undefined | — | Active snap point when controlled. Supports Angular two-way binding. |
defaultSnapPoint | DrawerSnapPoint | null | undefined | first point | Initial snap point when uncontrolled. |
stack | DrawerStackStore | undefined | — | Coordinates this drawer with a nested drawer stack. |
Use [(open)]="open", [(triggerValue)]="triggerValue", and [(snapPoint)]="snapPoint" for
two-way binding, or pair each input with its corresponding change output when using signals.
Outputs
| Output | Type | Description |
|---|---|---|
openChange | boolean | undefined | Emits the updated controlled open state. |
triggerValueChange | string | null | undefined | Emits the updated controlled trigger value. |
snapPointChange | DrawerSnapPoint | null | undefined | Emits the updated controlled snap point. |
escapeKeyDown | KeyboardEvent | Emits when Escape is pressed. |
focusOutside | DrawerFocusOutsideEvent | Emits when focus moves outside the drawer. |
interactOutside | DrawerInteractOutsideEvent | Emits for an interaction outside the drawer. |
pointerDownOutside | DrawerPointerDownOutsideEvent | Emits for a pointer-down event outside the drawer. |
requestDismiss | CustomEvent | Emits when another layer requests that this one dismiss. |
openChangeDetails | DrawerOpenChangeDetails | Emits detailed information about an open-state change. |
triggerValueChangeDetails | DrawerTriggerValueChangeDetails | Emits detailed information about a trigger-value change. |
snapPointChangeDetails | DrawerSnapPointChangeDetails | Emits detailed information about a snap-point change. |
[appDrawerTrigger]
| Input | Type | Default | Description |
|---|---|---|---|
value | string | undefined | — | Value used to identify this trigger when activated. |
<app-drawer-content>
| Input | Type | Default | Description |
|---|---|---|---|
draggable | boolean | true | Allows the content panel to be dragged between snap points. |
showHandle | boolean | true | Shows the built-in drag handle. |
class | string | "" | Additional classes applied to the inner drawer content panel. |
[appDrawerSwipeArea]
| Input | Type | Default | Description |
|---|---|---|---|
disabled | boolean | false | Disables swipe-to-open interactions for this area. |
swipeDirection | DrawerSwipeDirection | undefined | — | Overrides the root swipe direction for this area. |
Context, Providers, and Utilities
| Export | Angular API |
|---|---|
DrawerRootProvider | Directive that provides an externally created drawer API through value. |
DrawerContext | Structural directive [drawer-context] exposing the root API to a template. |
useDrawer(options) | Creates the signal-backed drawer machine in an Angular injection context. |
injectDrawerContext() | Injects the nearest drawer root context. |
injectDrawerContextCarrier() | Injects the context carrier used across portals. |
injectDrawerRenderStrategyContext() | Injects the drawer presence strategy context. |
injectDrawerStackContext() | Injects the nearest context created by [appDrawerStack]. |
DrawerImports | Readonly collection containing the drawer UI and context helpers. |
Types
| Export | Description |
|---|---|
DrawerApi | Connected drawer state and actions. |
DrawerElementIds | Overrides for generated drawer part IDs. |
DrawerMachineProps | Configuration accepted by the underlying drawer machine. |
DrawerOpenChangeDetails | Details emitted by openChangeDetails. |
DrawerTriggerValueChangeDetails | Details emitted by triggerValueChangeDetails. |
DrawerSnapPointChangeDetails | Details emitted by snapPointChangeDetails. |
DrawerFocusOutsideEvent | Event emitted by focusOutside. |
DrawerInteractOutsideEvent | Event emitted by interactOutside. |
DrawerPointerDownOutsideEvent | Event emitted by pointerDownOutside. |
DrawerSnapPoint | A numeric viewport ratio or CSS length string snap point. |
DrawerResolvedSnapPoint | Snap point after its size and offset have been resolved. |
DrawerSwipeDirection | "up", "down", "start", or "end". |
DrawerStackStore | Store used to coordinate nested drawers. |
DrawerStackSnapshot | Current aggregate state for a nested drawer stack. |
Angular
React
Solid
Svelte
Vue