Skip to content
SkillCodex
Menu

Drawer

Drawer

A temporary panel that slides from a viewport edge, overlays the page, and closes when its focused task is finished.

Try the component
Context, sources and actions
Sources and revision
Updated
Version
v1.0.26 · r2
Sources
5 sources
Status
Published
Read the sources

You may have searched for: a panel that slides in from the rightopen filters over the current pagea temporary side panel with a dark backdrop

All phrasings
Save and share

Recognize

Edge-attached surfaces

Try it

Should the surface stay persistent, enter from a side edge, or rise from the bottom?

Drawer

Shared trial context

A workspace places supporting navigation or controls along a screen edge while the main task stays in context.

Drawer

Mission

Drawer

Open the right-edge Filters, enable In stock, apply it, then reopen and press Escape to verify the draft is discarded and focus returns.

12 results

Office furniture

  • Compact desk

    In stock

  • Adjustable chair

    Made to order

Live result

The 12 office furniture results are visible. No filter is applied.

Step 1 of 3

Try

Try the component. Your live result appears just above. Move on at your own pace.

Behavior and edge case
What to observe
The temporary modal panel enters from the right over the furniture list, makes those results inert, and restores the Filters trigger after closing.
Edge case
At narrow widths every filter and action remains reachable, and Escape closes without applying a changed draft over the furniture results.

What this example shows

A Drawer is temporary and overlays content; a Sidebar stays in the layout, while a Bottom sheet is anchored to the bottom and supports mobile drag behavior.

Which fits your need?

Drawer

Editing filters without leaving results

Bottom sheet

Showing place details over a mobile map

Which component will you use here?
Difference and sources

A Drawer is temporary and overlays content; a Sidebar stays in the layout, while a Bottom sheet is anchored to the bottom and supports mobile drag behavior.

Read the sources

    Parts of the specimen

    Select a numbered marker on the schematic, or use the list below, to see its role. The schematic shows the concept's representative state.

    Backdrop

    The layer that separates a modal surface from inactive page content.

    Position in the atlas

    Relationship map

    Locate the chapter, neighboring concepts, and the next useful decision.

    • Chapter

      Edge-attached surfaces

      Drawer belongs to this comparison group.

    • Do not confuse

      Bottom sheet

      Choose Drawer if the panel is more structured and enters from the left or right. Choose Bottom sheet if the action is compact, especially on mobile, and benefits from staying above the content.

      Compare this pair
    • Do not confuse

      Sidebar

      Choose Drawer if the panel opens for a focused task and then closes, such as filters or a detail view. Choose Sidebar if the region must stay in place for navigation or persistent tools.

      Compare this pair
    • Next step

      Compare the concepts in the chapter before choosing an implementation.

      Open the chapter

    In your own words

    Understand

    What people describe

    Documented aliases: side drawer, slide-over, side sheet, side panel

    • a panel that slides in from the right
    • open filters over the current page
    • a temporary side panel with a dark backdrop
    • show cart details from the screen edge
    • a side window that closes with Escape
    • slide out settings without changing page

    Choose

    Use it when

    • Editing filters without leaving results
    • Showing a compact cart or inspector beside current content

    Avoid it when

    • The navigation must stay visible across pages
    • The task needs the full viewport or several steps

    Compare

    Compare similar concepts

    Platform equivalents

    The same interaction can have a different name or contract on each platform. Check the mapping before choosing an API.

    • HTML

      No direct primitive

      No direct primitive

      HTML has no drawer element; a drawer is composed from dialog or region semantics plus edge placement.

      Verified
    • WAI-ARIA APG

      No direct primitive

      No direct primitive

      APG has no drawer pattern; use dialog semantics only when the side panel is genuinely modal.

      Verified
    • Radix UI

      Partial

      Dialog.Root

      @radix-ui/react-dialog 1.1.x

      Radix has no Drawer primitive; Dialog supplies modality and focus while the side placement and gesture are custom.

      Verified Official documentation
    • shadcn/ui

      Partial

      Sheet

      shadcn/ui docs 2026-09-03

      Sheet is a Dialog-based side panel; navigation structure and swipe behavior are not inherent.

      Verified Official documentation
    • Material UI

      Direct

      Drawer

      Material UI v9.4.0

      Drawer provides temporary, persistent, and permanent side-panel variants.

      Verified Official documentation
    • SwiftUI

      No direct primitive

      No direct primitive

      SwiftUI has no general drawer primitive; NavigationSplitView is persistent layout, not a modal drawer.

      Verified
    • Jetpack Compose

      Direct

      ModalNavigationDrawer

      Android Developers 2026-08

      ModalNavigationDrawer supplies the modal edge panel, drawer state, scrim, and navigation content slot.

      Verified Official documentation
    • Flutter

      Direct

      Drawer

      Flutter API docs 2026-09

      Drawer integrates with Scaffold as a Material navigation panel that slides from the edge.

      Verified Official documentation

    Impact profile

    Measured implementation costs and operating constraints for this SkillCodex specimen. A missing evaluation is never treated as free.

    Rendering
    Client
    Lazy weight
    25 kB-gzip
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Sum of gzip -9 bytes for the lazy files of module 79748 in .next/server/app/(en)/term/[slug]/page/react-loadable-manifest.json after pnpm build:local at c9f1299.
    Low-end devices
    Fine
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Loaded the 390 x 844 term route in isolated Chromium with 6x CPU throttling and reduced motion, then exercised the first state change; failures are recorded as non-blocking warnings.
    CPU / GPU
    React state and a Radix DOM portal expose the side panel; width and position transitions use CSS, not canvas or WebGL.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Static source inspection of the target lab module plus an interaction on the isolated Chromium verification route; checked DOM/React work and absence of canvas or WebGL.
    Reduced motion
    The global reduced-motion contract collapses animation and transition durations; the same states and controls remain available.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Inspected src/app/globals.css prefers-reduced-motion rules and repeated the target interaction with reducedMotion=reduce in Chromium.
    Static fallback
    Without JavaScript, the term route stays on its localized Loading fallback; the profile and initial specimen are not revealed.
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Loaded all ten prerendered routes from a local next start build in Chromium with JavaScript disabled; each HTTP 200 remained on the localized Loading fallback, so the profile and specimen were not revealed.
    Server rendering
    Hydrates
    Measured ·
    Environment
    macOS 26.6.2; Node 24.19.0; pnpm 10.34.5; Next.js 16.3.0 Turbopack; Chromium 140
    Method
    Inspected the prerendered route response, then loaded the same route with JavaScript enabled and exercised the hydrated client specimen.
    Maintenance
    Stable

    Good fit

    • Temporary secondary tasks, filters or navigation that enter from an edge.

    Avoid when

    • Permanent navigation that belongs in the page layout.

    Verification checklist

    Try these actions in the lab, then check the same behaviours in your agent’s result. Adapt the example names to your interface.

    1. 1. Do this

      Open the drawer from its button, then close it with Escape.

      Expected result

      The temporary panel covers part of the page, then focus returns to the button that opened it.

    2. 2. Do this

      Apply a filter, reopen the drawer, change the draft and cancel without applying.

      Expected result

      The page keeps the last applied filter; cancelling does not silently apply the new draft.

    3. 3. Do this

      Use Tab and Shift+Tab through the drawer in a narrow window.

      Expected result

      All actions stay reachable. A modal drawer keeps focus inside and blocks the background; a non-modal drawer lets you return to the page.

    Full contract
    1. 1The panel is temporary and overlays the page
    2. 2Its edge and modal behavior are explicit
    3. 3Focus is contained and restored
    4. 4The narrow layout keeps every action reachable

    Understand → Recognize → Choose → Compare

    Pack for your agent

    Pre-written instructions to paste into your agent. Copying executes nothing.

    Implement correctly

    Build Drawer without breaking its behavior

    # Implement Drawer in your agent
    
    ## Objective
    Implement Drawer for this verified behavior: A temporary panel that slides from a viewport edge, overlays the page, and closes when its focused task is finished.
    
    ## Prerequisites
    - Inspect the repository, design system, and existing tests first.
    - Preserve unrelated changes and keep the file scope bounded.
    - Confirm that Drawer matches the need before writing code.
    
    ## Required behavior
    - The temporary panel overlays the page and moves in from a defined viewport edge.
    - While modal, keyboard focus stays inside the surface until it closes.
    - Escape closes the temporary surface and returns focus to a sensible control.
    
    ## States to cover
    - Drawer closed
    - Drawer open
    
    ## Accessibility
    - ARIA role: dialog[aria-modal=true]
    - The primary control or named region for Drawer has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    - Opening places focus on the drawer heading or first useful field, contains it, and closing restores the opener.
    - The named close control and Escape always work; backdrop dismissal is disabled when it could discard changes.
    - The accessible title and optional description identify the drawer task as focus enters.
    - Tab remains inside while open
    - Escape closes without applying unintended changes
    - Enter activates only the focused control
    
    ## When not to use
    - The navigation must stay visible across pages
    - The task needs the full viewport or several steps
    
    ## Acceptance criteria
    - The panel is temporary and overlays the page
    - Its edge and modal behavior are explicit
    - Focus is contained and restored
    - The narrow layout keeps every action reachable
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • @radix-ui/react-dialog
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The need is tied to canonical behavior before any technical choice.
    • States, accessibility, and non-goals prevent a merely visual implementation.
    • Acceptance criteria and the output format make verification observable.

    Try next

    Verify Drawer on a real journey

    # Verify Drawer after implementation
    
    ## Objective
    Audit the Drawer implementation against its behavior, states, and accessibility requirements without changing it automatically.
    
    ## Checks
    - Replay the smallest representative journey.
    - Check keyboard behavior, focus, accessible name, and announcements.
    - Tie each gap to a specific acceptance criterion.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:0455ba64400a0fc1853e85281090b5ff4a54ac32e06092c6f1fc683c82e4c588

    Diagnose a problem

    Find and fix the Drawer defect

    # Debug Drawer in your agent
    
    ## Observed symptom
    [DESCRIBE THE SYMPTOM HERE]
    
    ## Observable checks
    - Reproduce the issue with the smallest relevant journey.
    - Compare behavior with the documented states and transitions for Drawer.
    - Verify keyboard behavior, focus, accessible name, and announcements.
    
    ## Possible causes
    - The chosen primitive does not match the expected behavior.
    - A state, transition, or focus return is missing.
    - A neighboring component captures an event or hides an accessible signal.
    
    ## Bounded corrections
    - Fix the reproduced cause without recreating neighboring components.
    - Preserve the public contract and add a focused regression test.
    - Do not install dependencies or change remote state without authorization.
    
    ## Final verification
    - The panel is temporary and overlays the page
    - Its edge and modal behavior are explicit
    - Focus is contained and restored
    - The narrow layout keeps every action reachable
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    
    • @radix-ui/react-dialog
    • Requires · Access to the repository, design system, and tests
    Why it works
    • The explicit symptom prevents starting from an assumed fix.
    • Checks separate behavior, accessibility, and neighboring interference.
    • The fix stays bounded and must produce regression evidence.

    Try next

    Lock in the Drawer fix

    # Prevent the Drawer regression
    
    ## Objective
    Turn the reproduced cause into a focused regression test and compare Drawer with neighboring concepts before widening the fix.
    
    ## Checks
    - Prove that the test fails before the fix.
    - Prove that it passes after the bounded fix.
    - Verify that no neighboring component changed behavior.
    
    ## Guardrails
    - Show the proposed changes before any external action.
    - Do not publish, send, delete, pay for, or change remote state without explicit authorization.
    - Preserve unrelated changes and stop if the scope becomes ambiguous.
    
    ## Output format
    - Outcome or verdict.
    - Files or actions involved.
    - Checks run and observable evidence.
    - Remaining blockers or limitations.
    

    sha256:9cccdf1ab905455275fa9ec9b5415cc06c0af9bfbca28e0f636ae6aa0e60ac03

    Full entry, saving and provenance

    Pre-written instruction by SkillCodex — your request is neither sent nor used to adapt this text; no content is generated, and copying executes nothing.

    Pack digest: sha256:9234eaabe14e7a736eca5cd38e7e9c42b53f7f06f2e06045eec1937219ffce6b

    In code

    TechnologyPrimitiveVersionCaveat
    @radix-ui/react-dialog

    Dialog.Root

    @radix-ui/react-dialog@1.1.19Radix has no Drawer primitive. This binding composes Dialog as a modal side panel and keeps placement separate from modality.

    Technical details

    Behaviors

    • Enter from an edge

      The temporary panel overlays the page and moves in from a defined viewport edge.

    • Contain focus

      While modal, keyboard focus stays inside the surface until it closes.

    • Dismiss with Escape

      Escape closes the temporary surface and returns focus to a sensible control.

    States

    • Drawer closed

      Drawer closed

    • Drawer open

      Drawer open

    State transitions

    • Drawer closed → Drawer open

      The Filters trigger is activated and the temporary panel enters from the right edge.

    • Drawer open → Drawer closed

      Apply, Close, or Escape dismisses the drawer and restores focus to Filters.

    Test scenarios

    Context
    An office-furniture results page shows the same Compact desk and Adjustable chair list while people filter availability and navigate categories without leaving the results.
    Mission
    Open the right-edge Filters, enable In stock, apply it, then reopen and press Escape to verify the draft is discarded and focus returns.
    Primary state
    The temporary modal panel enters from the right over the furniture list, makes those results inert, and restores the Filters trigger after closing.
    Edge case
    At narrow widths every filter and action remains reachable, and Escape closes without applying a changed draft over the furniture results.

    Visual signals

    • Tall panel attached to a viewport edge
    • Page remains visible under a backdrop
    • Close control inside the panel

    Behavioral signals

    • Overlays rather than resizes the page
    • Focus is contained when modal
    • Enters and exits from the same edge

    Accessibility

    Role
    dialog[aria-modal=true]
    Accessible name
    The primary control or named region for Drawer has a stable accessible name from visible text or an explicit programmatic label; placeholder text and tooltips are not names.
    Focus
    Opening places focus on the drawer heading or first useful field, contains it, and closing restores the opener.
    Dismissal
    The named close control and Escape always work; backdrop dismissal is disabled when it could discard changes.
    Scroll
    The page behind the surface stays fixed. Long content scrolls inside the panel, and touch dragging does not steal scrolling from nested content.
    Announcement
    The accessible title and optional description identify the drawer task as focus enters.
    Keyboard
    • Tab remains inside while open
    • Escape closes without applying unintended changes
    • Enter activates only the focused control

    Bindings

    Open the HTML, ARIA, Radix, and shadcn matrix
    • Dialog.Root

      implementationKind
      shadcn-radix
      nativeElement
      Not applicable
      ariaPattern
      dialog
      radixPrimitive
      Dialog
      shadcnRecipe
      Sheet
      runtimeDependency
      @radix-ui/react-dialog@1.1.19
      packageName
      @radix-ui/react-dialog
      exportName
      Dialog.Root
      exactVersion
      1.1.19
      status
      verified
      sourceId
      source-ui-shadcn-sheet
      deprecationStatus
      active
      replacement
      Not applicable
      validFrom
      Not applicable
      validUntil
      Not applicable

      Equivalence caveat: Radix has no Drawer primitive. This binding composes Dialog as a modal side panel and keeps placement separate from modality.

      Verify binding source

    Sources

    • WAI-ARIA APG: Dialog Modal Pattern
      sourceId
      source-ui-aria-dialog-modal
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/ARIA/apg/patterns/dialog-modal/
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-09T07:07:35Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:4282d2eeb383c717ba41f52f0db1643fb3eb9acc33fa3879ef817e27c162453e
      status
      verified

      Claim covered: Drawer: informative APG guidance for the modal dialog pattern: roles, states, relationships, and keyboard interaction.

    • shadcn/ui: Sheet
      sourceId
      source-ui-shadcn-sheet
      kind
      documentation
      canonicalUrl
      https://ui.shadcn.com/docs/components/radix/sheet
      publisher
      shadcn/ui
      sourceRevision
      http-etag:W/"g1c3izg3ygj11s"
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:e7dc393f84311c3f9e4077863e7f8838ca139ce207ac6a604a063366af711519
      status
      verified

      Claim covered: Drawer: documented parts, state APIs, interaction behavior, and implementation limits for shadcn Sheet.

    • Radix Primitives: Dialog
      sourceId
      source-ui-radix-dialog
      kind
      documentation
      canonicalUrl
      https://www.radix-ui.com/primitives/docs/components/dialog
      publisher
      Radix Primitives
      sourceRevision
      http-etag:W/"df76fcc1be71ddeff0677a09beda6d7e"
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:068577fa4c5cf2ccc711b9e97e2473ed516e4840e220f2b2f03c552d346fc92f
      status
      verified

      Claim covered: Drawer: documented parts, state APIs, interaction behavior, and implementation limits for Radix Dialog.

    • WAI-ARIA 1.2: Roles Model
      sourceId
      source-ui-wai-aria-roles
      kind
      standard
      canonicalUrl
      https://www.w3.org/TR/wai-aria-1.2/#roles
      publisher
      W3C WAI
      sourceRevision
      W3C-REC-wai-aria-1.2-20230606
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:c0fea16fc747779569ab754d2d25bca3e2b7e8a673b8ef5362aeb9ebc73a4849
      status
      verified

      Claim covered: Drawer: normative ARIA role definitions and constraints for the stated accessible role.

    • WCAG 2.2: Focus Appearance
      sourceId
      source-ui-wcag-understanding-focus-appearance
      kind
      documentation
      canonicalUrl
      https://www.w3.org/WAI/WCAG22/Understanding/focus-appearance.html
      publisher
      W3C WAI
      sourceRevision
      http-last-modified:2026-07-02T10:07:49Z
      consultedAt
      2026-07-19
      license
      Not stated
      contentDigest
      sha256:fdcf316a1f0e3cc758eda9618322d132862124ff0a3f3b1a3acbf20daf804ff0
      status
      verified

      Claim covered: Drawer: informative WCAG guidance for evaluating visible keyboard focus appearance.