Getting StartedInstallation and setup guides 5
LayoutWorkflow and structural layout components 7
OverlayModal and floating layer surfaces 3
FeedbackStatus, empty, progress, and loading placeholder patterns 5
FormInput and selection components 17
UtilityGeneral-purpose interface utilities 7
NavigationMenu surfaces and hierarchical actions 7

API reference

Drawer provides a container directive (tngDrawerContainer), drawer directive (tngDrawer), content directive (tngDrawerContent), and a styled wrapper component (<tng-drawer>).

[tngDrawerContainer] directive

Attach on a wrapper element that hosts one or more drawers and the main content. Manages backdrop, scroll lock, and coordination between multiple drawers.

Inputs

InputTypeDefaultNotes
hasBackdrop'auto' | boolean'auto'Show backdrop when any overlay drawer is open.
closeOthersOnOpenbooleantrueClose other drawers when one opens.
animatebooleantrueEnable open/close animations.
lockScroll'auto' | boolean'auto'Lock body scroll when overlay drawer is open.
dir'ltr' | 'rtl' | 'auto''auto'Layout direction for start/end positioning.

Host attributes

AttributeValuePurpose
data-slot"drawer-container"Stable styling and query hook.
data-directionResolved directionCurrent layout direction.
data-content-countNumberNumber of drawer content slots.
data-content-conflictPresent when conflictIndicates push/side mode conflict.

[tngDrawer] directive

Attach on the drawer panel element. Controls open state, mode, position, focus trap, and accessibility.

Inputs

InputTypeDefaultNotes
openedbooleanControlled open state.
defaultOpenedbooleanfalseInitial uncontrolled open state.
mode'overlay' | 'push' | 'side''overlay'How drawer overlays or displaces content.
position'start' | 'end''start'Side of the viewport.
disabledbooleanfalseDisable drawer interactions.
backdrop'auto' | boolean'auto'Show backdrop (overlay mode).
closeOnOutsideClickboolean | undefinedClose on backdrop click; undefined inherits from container.
closeOnEscapebooleantrueClose on Escape key.
restoreFocusbooleantrueRestore focus to trigger on close.
autoFocus'drawer' | 'first-focusable' | 'none''drawer'Focus target when opening.
trapFocus'auto' | boolean'auto'Trap focus inside drawer when open.
role'navigation' | 'dialog' | 'complementary' | 'region''navigation'ARIA role for the drawer.
inertContentbooleanfalseMake main content inert when open.
allowBodyScrollbooleanfalseAllow body scroll when overlay drawer is open.
swipeToClosebooleanfalseClose on swipe gesture (touch).
fixedInViewportbooleanfalseFix drawer within viewport bounds.
fixedTopGapnumber0Gap from top when fixed in viewport.
fixedBottomGapnumber0Gap from bottom when fixed in viewport.

Outputs

OutputPayloadWhen it fires
openedChangebooleanOpen state changes.
tngDrawerOpenedAfter drawer finishes opening.
tngDrawerClosedAfter drawer finishes closing.
openStartWhen open animation begins.
closeStartWhen close animation begins.
backdropClickWhen backdrop is clicked.
positionChange'start' | 'end'When position changes.

Host attributes

AttributeValuePurpose
data-slot"drawer"Stable styling and query hook.
data-stateopen/closedCurrent open state.
data-positionstart/endCurrent position.
data-modeoverlay/push/sideCurrent mode.
data-sideleft/rightResolved side for RTL.
data-disabledPresent when disabledDisabled state.
hiddenPresent when closedVisibility for closed state.

[tngDrawerContent] directive

Attach on the main content element. Receives offset from the container in push/side mode when drawers are open.

Host attributes

AttributeValuePurpose
data-slot"drawer-content"Stable styling and query hook.

<tng-drawer> component

Styled wrapper that uses tngDrawer via host directives. Exposes all primitive inputs/outputs plus component-specific API.

Inputs

InputTypeDefaultNotes
ariaLabelstring'Drawer'Accessible label for the drawer.
Plus all primitive inputs from tngDrawer: opened, defaultOpened, mode, position, disabled, backdrop, closeOnOutsideClick, closeOnEscape, restoreFocus, autoFocus, trapFocus, role, inertContent, allowBodyScroll, swipeToClose, fixedInViewport, fixedTopGap, fixedBottomGap.

Outputs

OutputPayloadWhen it fires
All primitive outputs from tngDrawer: openedChange, tngDrawerOpened, tngDrawerClosed, openStart, closeStart, backdropClick, positionChange.

Methods

MethodSignatureDescription
open()() => voidOpens the drawer.
close()() => voidCloses the drawer.
toggle(force?)(force?: boolean) => voidToggles open state; optional force to set explicitly.
isOpen()() => booleanReturns current open state.
setRestoreFocusFallback(target)(target: HTMLElement | null) => voidSets fallback element for focus restore when trigger is unavailable.
setRestoreFocusTarget(target)(target: HTMLElement | null) => voidSets explicit target for focus restore on close.