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
  • Modal

Modal

A centred dialog over the page, for a short task or a message. Every one needs an accessible name, through `title`, `aria-labelledby` or `aria-label`.

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.
  • Overview
  • Props
  • Figma

Modal props

NameTypeDefault ValueDescriptionUsage count
aria-labelstringundefined
aria-labelledbystringundefined
decorReactNode
descriptionReactNode
forceHideCloseButtonbooleanundefinedfalseIn some specific cases, the close button can be handled manually by the code using <Modal> as part of it's `children`. In these cases, we want to hide the default close button even if the `onClose` prop is defined.
imageReactNodeImage to display on the left of the modal. @beta
isOpenbooleanundefinedfalse
onClose(() => void)undefined
shouldFocusAfterRenderbooleanundefinedtrue
styles
5 possibilities{ overlay?: CSSPropertiesundefined; content?: CSSPropertiesundefined; width?: stringundefined; }undefined
titlestringundefined
Edit this page
Previous
DropdownMenu
Next
Popover