Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
    • BottomSheet
    • DialogBox
    • DropdownMenu
    • Modal
    • Popover
    • Screen
    • SidebarModal
    • Tooltip
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
  • Overlays
  • SidebarModal

SidebarModal

A panel that slides in from the side for extra detail, without leaving the page. Opened by name through `useShowSidebar`.

Health
Component health
Source
View on Github
Design
View Figma
Storybook
View in Storybook
Playground
No Example
Accessibility

partially-compliant

Platform
Web
Accessibility issues
The focus is trapped correctly. The modal is missing a labelledby attribute. The first interactive element is not focused when the modal is opened. The main content is not hidden from screen readers when the modal is opened.
  • Overview
  • Props
  • Figma

Opening​

Every SidebarModal is declared with a name. To open a modal, you need to use the useShowSidebar hook, which returns a function to use to open a specific modal (e.g.show('my-modal')).

Closing​

SidebarModal can be closed by clicking on the close button or by clicking on the overlay. You can also close a modal by using the useHideSidebar hook, which returns a function to use to close the opened modal (e.g.hide()).

Accessibility​

The SidebarModal component comes with a SidebarModal.Title component that should be used to provide a title for the modal.

When using it, make sure other modal headings are start at h3 level or below.

SidebarModal props

NameTypeDefault ValueDescriptionUsage count
aria-labelstringAccessible name of the dialog. Prefer `aria-labelledby` when a visible title exists.
aria-labelledbystringId of the visible element naming the dialog.
backButtonLabelstring
childrenReactNode
closeButtonLabelstring
coverReactNode
idstring
name*stringRegExp
onClose() => void
onGoBack() => void
scrollOffsetnumber
showBackButtonboolean
showCloseButtonboolean
sizeSideModalSize
styleCSSProperties
Edit this page
Previous
Screen
Next
Tooltip
  • Opening
  • Closing
  • Accessibility