Skip to content

XDS: no Drawer/Sheet component for side-anchored slide-in panels #2575

Closed

Description

@rubyycheung

Summary

There's no XDS component for a side-anchored drawer / sheet — a panel that slides in from an edge (right/left/bottom) and overlays content, with backdrop + Escape + focus management. This is a common pattern (mobile detail panels, filter sheets, artifact/document viewers that slide in from the side).

What exists today

  • XDSDialog — a centered modal, with variant: 'standard' | 'fullscreen'. fullscreen fills the entire viewport; standard is centered. Neither is edge-anchored.
  • ChatComposerDrawer — chat-composer-specific, not a general drawer.
  • XDSLayoutPanel — an in-layout panel (part of the page layout), not an overlay that slides over content.

The gap

To build a right-side slide-in drawer, a consumer has to take XDSDialog and reshape it with custom CSS:

// custom CSS reshaping a centered dialog into a right drawer — undesirable
{
  margin: 0,
  inset: 0,            // or insetInlineEnd:0; insetInlineStart:auto
  height: '100dvh',
  width: '90vw',
  borderRadius: 0,
  translate: { default: '0 0', '@starting-style': '100% 0' },
  transitionProperty: 'translate, overlay, display',
  transitionBehavior: 'allow-discrete',
  // ...
}

That's a lot of bespoke CSS reimplementing positioning + entry animation that a first-class component should own. In templates (which should avoid component-fighting custom CSS), this isn't acceptable.

Proposed solution

A dedicated XDSDrawer (or XDSSheet) component, or a placement/anchor prop on XDSDialog:

<XDSDrawer isOpen={open} onOpenChange={setOpen} side="end" size="md">
  ...
</XDSDrawer>
  • side: 'start' | 'end' | 'top' | 'bottom' (logical, RTL-aware).
  • Built-in slide-in animation (via @starting-style, which StyleX supports).
  • Backdrop + Escape + focus trap (same machinery as XDSDialog).
  • Sizing presets + full-bleed option.

Context

Building the ai-chat-artifact page template, the mobile artifact view wanted a right-side slide-in. We had reshaped XDSDialog with custom CSS; per the "templates use pure components, no custom hacks" rule we removed that and fell back to XDSDialog variant="fullscreen" (full-viewport takeover), which works but isn't an edge-anchored drawer. Filing this so the side-drawer pattern becomes first-class. Related Chat gaps from the same template: #2572, #2573, #2574.

Activity

  1. added
    enhancement
    component
    on Jun 10, 2026
  2. cixzhang commented on Sep 2, 2026

    @cixzhang
    Contributor

    Thanks for filing this — the side-anchored panel gap it describes is now filled. A Drawer with side="start" | "end", scrim/Escape/focus handling and a @starting-style slide-in ships in packages/lab/src/Drawer/, and BottomSheet in core covers the bottom-anchored case. The remaining API questions (layer integration, optional mobile swipe) are tracked on #3675, so closing this in favour of that RFC. Please reopen if the shipped Drawer misses a case you needed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    componentenhancement

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions