Search documentation

Search the documentation and open a page.

A panel that slides in from the edge of the screen and can be dismissed by dragging or interacting with a control.

Loading...

Installation

pnpm dlx shadcn@latest add @wirekyt/drawer

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

InputTypeDefaultDescription
idstring | undefinedgeneratedUnique identifier used to connect the drawer parts.
idsPartial<DrawerElementIds> | undefined—Overrides generated identifiers for individual parts.
openboolean | undefined—Open state when controlled. Supports Angular two-way binding.
defaultOpenbooleanfalseInitial open state when uncontrolled.
modalbooleantrueEnables modal behavior.
closeOnInteractOutsidebooleantrueCloses the drawer after an allowed outside interaction.
closeOnEscapebooleantrueCloses the drawer when Escape is pressed.
preventScrollbooleantruePrevents document scrolling while the drawer is open.
trapFocusbooleantrueKeeps keyboard focus inside the open drawer.
restoreFocusbooleantrueRestores 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.
triggerValuestring | null | undefined—Active trigger value when controlled. Supports Angular two-way binding.
defaultTriggerValuestring | null | undefined—Initial active trigger value when uncontrolled.
snapPointsDrawerSnapPoint[] | undefined[1]Snap points expressed as viewport ratios or CSS length strings.
swipeDirectionDrawerSwipeDirection | undefined"down"Edge toward which the drawer closes when swiped.
snapToSequentialPointsbooleanfalseMoves through adjacent snap points instead of skipping between them.
swipeVelocityThresholdnumber | undefined500Release velocity that opens the drawer, in pixels per second.
closeThresholdnumber | undefined0.5Drag progress required to close the drawer.
preventDragOnScrollbooleantruePrevents a drawer drag from taking over an active scroll gesture.
snapPointDrawerSnapPoint | null | undefined—Active snap point when controlled. Supports Angular two-way binding.
defaultSnapPointDrawerSnapPoint | null | undefinedfirst pointInitial snap point when uncontrolled.
stackDrawerStackStore | undefined—Coordinates this drawer with a nested drawer stack.

Outputs

OutputTypeDescription
openChangeboolean | undefinedEmits the updated controlled open state.
triggerValueChangestring | null | undefinedEmits the updated controlled trigger value.
snapPointChangeDrawerSnapPoint | null | undefinedEmits the updated controlled snap point.
escapeKeyDownKeyboardEventEmits when Escape is pressed.
focusOutsideDrawerFocusOutsideEventEmits when focus moves outside the drawer.
interactOutsideDrawerInteractOutsideEventEmits for an interaction outside the drawer.
pointerDownOutsideDrawerPointerDownOutsideEventEmits for a pointer-down event outside the drawer.
requestDismissCustomEventEmits when another layer requests that this one dismiss.
openChangeDetailsDrawerOpenChangeDetailsEmits detailed information about an open-state change.
triggerValueChangeDetailsDrawerTriggerValueChangeDetailsEmits detailed information about a trigger-value change.
snapPointChangeDetailsDrawerSnapPointChangeDetailsEmits detailed information about a snap-point change.

[appDrawerTrigger]

InputTypeDefaultDescription
valuestring | undefined—Value used to identify this trigger when activated.

<app-drawer-content>

InputTypeDefaultDescription
draggablebooleantrueAllows the content panel to be dragged between snap points.
showHandlebooleantrueShows the built-in drag handle.
classstring""Additional classes applied to the inner drawer content panel.

[appDrawerSwipeArea]

InputTypeDefaultDescription
disabledbooleanfalseDisables swipe-to-open interactions for this area.
swipeDirectionDrawerSwipeDirection | undefined—Overrides the root swipe direction for this area.

Context, Providers, and Utilities

ExportAngular API
DrawerRootProviderDirective that provides an externally created drawer API through value.
DrawerContextStructural 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].
DrawerImportsReadonly collection containing the drawer UI and context helpers.

Types

ExportDescription
DrawerApiConnected drawer state and actions.
DrawerElementIdsOverrides for generated drawer part IDs.
DrawerMachinePropsConfiguration accepted by the underlying drawer machine.
DrawerOpenChangeDetailsDetails emitted by openChangeDetails.
DrawerTriggerValueChangeDetailsDetails emitted by triggerValueChangeDetails.
DrawerSnapPointChangeDetailsDetails emitted by snapPointChangeDetails.
DrawerFocusOutsideEventEvent emitted by focusOutside.
DrawerInteractOutsideEventEvent emitted by interactOutside.
DrawerPointerDownOutsideEventEvent emitted by pointerDownOutside.
DrawerSnapPointA numeric viewport ratio or CSS length string snap point.
DrawerResolvedSnapPointSnap point after its size and offset have been resolved.
DrawerSwipeDirection"up", "down", "start", or "end".
DrawerStackStoreStore used to coordinate nested drawers.
DrawerStackSnapshotCurrent aggregate state for a nested drawer stack.