A side navigation container that provides quick access between views within an application.
The edge positions (start, end, top, bottom) render a modal <dialog>
with a focus trap and a backdrop. The relative position renders an inline
<nav> landmark.
Content in the mini slot renders a compact variant, which shows while the
drawer is closed.
The component integrates with the
Invoker Commands API:
an Ignite button or a native <button> with command="--show" / "--hide" / "--toggle"
and commandfor pointing to this element calls the corresponding method
declaratively without any JavaScript.
- Element
-
igc-nav-drawer
- Slots
-
default— Renders the main navigation content of the drawer. -
mini— Renders the compact mini variant of the drawer.
- CSS Parts
-
base— The base wrapper of the drawer. -
main— The main content container of the drawer. -
mini— The mini variant container of the drawer. -
hidden— Added to the mini part when the mini slot has no content.
Properties
Section titled "Properties"keepOpenOnEscape
Section titled "keepOpenOnEscape"Whether the drawer stays open when the user presses Escape. Applies only to the edge positions, because Escape does not close a relative drawer.
keepOpenOnEscape: boolean = false Defined in src/components/nav-drawer/nav-drawer.ts:168
Optional label
Section titled "label"The accessible label of the <dialog>, or of the <nav> landmark in the relative
position, and of the mini variant. Give each navigation landmark on a page a distinct label.
label: string Defined in src/components/nav-drawer/nav-drawer.ts:177
Whether the drawer is open.
open: boolean = false Defined in src/components/nav-drawer/nav-drawer.ts:158
position
Section titled "position"The position of the drawer.
start- anchored to the inline-start edge (default).end- anchored to the inline-end edge.top- anchored to the block-start edge.bottom- anchored to the block-end edge.relative- rendered inline within the page flow; no modal backdrop.
position: NavDrawerPosition = 'start' Defined in src/components/nav-drawer/nav-drawer.ts:146
tagName
Section titled "tagName"The tagName read-only property of the Element interface returns the tag name of the element on which it's called.
tagName: "igc-nav-drawer" = 'igc-nav-drawer' Defined in src/components/nav-drawer/nav-drawer.ts:77
Methods
Section titled "Methods"Closes the drawer. Returns true after the exit, or false when it is already closed or a
reopen ends the exit.
hide(): Promise<boolean> Defined in src/components/nav-drawer/nav-drawer.ts:317
Returns Promise<boolean>
Opens the drawer. Returns true on success, or false when it is already open.
show(): Promise<boolean> Defined in src/components/nav-drawer/nav-drawer.ts:309
Returns Promise<boolean>
toggle
Section titled "toggle"Toggles the open state of the drawer.
toggle(): Promise<boolean> Defined in src/components/nav-drawer/nav-drawer.ts:322