Axon 911 Frontend Docs
    Loading navigation…
U
User
Switch to light mode
  1. Components
  2. Drawer
  3. Usage

Drawer

Usage

Overview
Drawer displays content in a sliding panel anchored to either side of the viewport. It preserves the current context while keeping the main interface uncluttered. Built on Motion for smooth animations and Zustand for state management, Drawer supports multiple anchor positions, custom sizing, portal rendering, and controlled state management—making it ideal for sidebars, panels, and overlay content.
When to use
Among the most common—and controversial—matters that arise in interface design is when to use a drawer versus a modal dialog or even another page. Abide by these guidelines when determining when to use one or another.
To stay in context
Drawer’s chief advantage is that it keeps users in context—where they are on the page—without pushing them into a modal dialog or sending them to another page. In structured workflows where users need to view information side-by-side, drawers are essential. The goal is to minimize cognitive overhead: show more information at once without crowding the interface. That’s why Drawer typically hovers over other elements (positioned absolutely) rather than rendering as an inline panel.
View larger
When coupled with DataTable
Drawer is tailor-made for use with DataTable for the reasons mentioned above. While users browse, filter, and search on the table, they click on a row that opens a drawer containing details about a particular entity—a recording, a protocol, a user—and in many cases contains a form for making modifications.
View larger
In cramped spaces
In data-heavy interfaces, where every pixel counts, drawer provides an escape valve through which users can access critical information without leaving their current context.
View larger

When not to use
In confirmation patterns
When abandoning a workflow or deleting an item, Dialog is ideal, adding intentional friction by removing the user from the context and requiring that they confirm their intent.
For extended workflows
For extended workflows that require viewing multiple sources of information at once, use TakeoverModal. This is especially the case when a workflow is linked to a DataTable. Drawer, in fact, provides a perfect jump off point into a TakeoverModal: the instance of Drawer supplies high-level details with a CTA to enter a workflow in TakeoverModal.
View larger

Composition
Every drawer should include a header and body, with an optional footer for action buttons. By default, each Drawer section should use padding={2} (16px).
Header

Drawer title

01234567893
Status
Reset zoom to 100%
Title
Use a descriptive title for the drawer or dynamic content, such as the AI-generated title of a call, if succinct. Use text truncation to prevent overflow.
Counter
If a drawer contains a set of items, show a counter to the immediate right of the title. Always use the Default color at the Regular size.
Badge
Optionally add a badge to convey status or state to the right of the title and, if used, the counter.
Icon Button
An icon button can serve as an external link when placed to the left of the dismissal button.
Dismissal Button
Flush right against the side of the drawer header, the dismissal button closes the drawer and should appear with a double chevron icon.
Body

Armed suspect fires shots, flees in vehicle.

Drawer sections
0:00
0:00/0:00
Call Taker
Jane Doe
Incident Type
Hit and Run
QA Form
Hit and Run Form
CAD ID
1924Z830295U03
Overall Score
Unconfirmed
71.82%615/855
10 passed · 3 failed · 2 NA · 2 Unavailable
Scenarios
All 911 CallsVehicle Related
Questions
QuestionResult
Detailed rationale for this step appears here in the live product.
Reset zoom to 100%
Body contents vary widely based on use case. Some general principles nonetheless apply:
  • Use discrete sections rather than Separators. A Drawer body may contain several sections; each should use borders that span to the edge of the drawer rather than a Separator, which respects horizontal padding.
  • Use DataList for key-pair values, such as providing metadata about a call (e.g., title, summary, location, etc.).
  • Use SegmentedControl to split content. If necessary, nest it in a Scrollable to support horizontal overflow—or, better yet, reduce the number of sections.
  • Refrain from adding child elements with extra padding to ensure that elements appear vertically aligned.
  • Consider height limitations by adding Scrollable to sections with contents likely to overflow available space. Use smallScrollbar to keep the scrollbar narrow and scroll for scrollbarVisibility, such that it vanishes when the user isn't scrolling.
Footer
Draft
Review changes before publishing.
Reset zoom to 100%
CTA Block
An optional section, the Drawer footer should contain up to two CTA buttons on the right hand side (spaced apart by a gap of 2 , or 16px).
Badge
Placed flush left, a Badge can indicate the state of actions in the drawer, such as "draft" or "published." Use sparingly.
Informational Text
More frequently used is informational text, also flush left, with guidance or key information related to the workflows triggered with the CTA buttons.

Positioning
Anchor Position
Although the component supports left and right anchors, the system standard is right-anchored drawers.
Floating Drawers
Positioned absolutely, a floating Drawer occludes content on the page and must be dismissed to view what it hides. An exception is DataTable: when paired with Drawer, users can scroll horizontally behind the drawer to view each column. A floating drawer is preferable when used with DataTable and in cramped interfaces.
View larger
Inline Drawers
An inline drawer lives in the normal flow of the DOM. When it appears, the drawer slides in from its edge and surrounding items resize in step with it; closing reverses the motion. The row that contains it must use overflow: clip, not overflow: hidden, so focus entering the animated drawer cannot scroll the surrounding page sideways. Inline drawers can also serve as conditionally visible panels in interfaces with sufficient space.
View larger
Stacking
Drawer takes no zIndex; where it stacks follows from modal and placement:
  • Modal. showModal puts the panel in the top layer, above everything on the page, whatever its placement.
  • Non-modal, Viewport or Container. show is not the top layer. The panel stacks at --z-overlay in the page's stacking order: above page content stacked lower (sticky headers, dropdown-level boxes) and below every top-layer surface, so a popover, menu, select or tooltip opened from inside the drawer, a toast, and a modal dialog all appear above it. The toast stack stays above non-modal drawers by design.
  • Non-modal, Inline. The panel is in flow and stacks with its siblings.
A non-modal panel renders where it sits in the React tree. Inside an ancestor that creates a stacking context or a containing block (transform, filter, contain, will-change, or a positioned box with a z-index), a Viewport or Container panel is confined to that ancestor: --z-overlay orders it only inside it, and a Viewport panel is laid out against it instead of the viewport. So render an app-level drawer at the shell's root, through Drawer host. A remote that needs a page-level panel asks the shell's DrawerHost for it with navigation.openDrawer, or opens a modal drawer.

Customization
Width
Defaulting to 45rem, Drawer accommodates custom widths between 40rem and 67dvw. Override the default width if the purpose of the drawer is to showcase items of a large size, such as media or maps.
Click outside to close
In addition to clicking the dismissal button, users can press the ESC key to dismiss a drawer. Since auto-saving is generally unsupported, only enable clicking outside to dismiss if a drawer contains informational or read-only content.

Related Components
  • Dialog for blocking confirmations and intentional friction.
  • Popover for lightweight, non-blocking secondary content.
  • Sidebar for persistent app-shell navigation.
  • Data table for the row-selection pattern that opens a drawer.
Previous
DragSource / API
Next
Drawer / API and Development
On this page
Overview
When to use
To stay in context
When coupled with DataTable
In cramped spaces
When not to use
In confirmation patterns
For extended workflows
Composition
Header
Title
Counter
Badge
Icon Button
Dismissal Button
Body
Footer
CTA Block
Badge
Informational Text
Positioning
Anchor Position
Floating Drawers
Inline Drawers
Stacking
Customization
Width
Click outside to close
Related Components