Drawer overview
Drawer provides a slide-in panel from the start or end side. Use the headless primitives for full control over layout and animation, or the styled component for quick integration.
Imports
Select the layer that matches your ownership model.
Primitive import
ts
import { TngDrawerContainer, TngDrawer, TngDrawerContent } from '@tailng-ui/primitives';
Component import
ts
import { TngDrawerComponent } from '@tailng-ui/components';Drawer variants
Same drawer semantics rendered through headless markup, plain CSS wrappers, and Tailwind utility shells.
Headless drawer
Main content area
Plain CSS drawer
Main content area
Tailwind drawer
Main content area
Keyboard interaction
Escapecloses the drawer whencloseOnEscapeis enabled.Tabcycles focus within the drawer when focus trap is active.- Focus is restored to the trigger element on close.
Accessibility baseline
- Drawer panel supports role
"dialog","navigation","complementary", or"region". - Focus trap keeps Tab navigation within the open drawer.
- Main content can be marked inert when the overlay drawer is open.
- RTL layout resolves
"start"/"end"positions correctly.