Skip to main content
Brand and assets
Build
Monitor and contribute
/
Component library
  • All components
  • Buttons & actions
  • Forms & inputs
  • Layout & containers
  • Overlays
  • Feedback & status
  • Data display
  • Typography
  • Accessibility
  • Contrib
  • Deprecated
    • Alert
    • ButtonDeprecated
    • Collection
    • DateInputDeprecated
    • Dropdown
    • Frame
    • FullWidthModal
    • LegacyTable
    • SearchInputDeprecated
    • SelectOptionItem
    • Table
    • TextDeprecated
    • TooltipDeprecated
  • Deprecated
  • FullWidthModal

FullWidthModal

Deprecated

Deprecated component

Do not use it in new code. It stays documented to help migrate its remaining usages.

Do not use modals for fullscreen layouts.

Use instead:

  • FullPageLayout from murray/web: It provides the same UI elements.

A full-width modal for a flow with more than one step. Declared with a `name` and opened through `useShowFullWidthModal`.

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

partially-compliant

Platform
Web
Accessibility issues
Announced as a modal dialog, named after its title. Focus moves into the modal on open and back to the trigger on close. This component does not have a focus trap.
  • Overview
  • Props
  • Figma

Opening​

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

Accessible name​

Screen readers announce the modal by its name, so every FullWidthModal needs one:

  • title: the header title names the modal.
  • aria-labelledby: the id of a heading rendered in the content, such as <FullWidthModal.Title id="…">.
  • aria-label: a label, when no visible heading fits.

Closing​

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

Footer​

You can add an optional footer by adding the containsFooter attribute on <FullWidthModal>, and rendering <FullWidthModal.Footer modalName="the-same-name-as-the-parent-modal"> inside the modal. There is currently no way to NOT duplicate the modal name.

With steps​

If you have a multiple steps in your full-width modal, you can wrap the content of the modal inside a FullWidthModal.SideBarWrapper. It will add a sidebar on the left of the modal with the list of steps, highlighting the current step.

FullWidthModal props

NameTypeDefault ValueDescriptionUsage count
aria-labelstring
aria-labelledbystring
backButtonLabelstring
children*ReactNode
closeButtonLabelstring
containsFooterbooleanA modal with a footer will render differently (to leave space for the footer), so it needs to know if a footer is rendered inside. Forgetting to set this will make the scrollbar disappear under the footer when scrolling at the bottom of the content.
headerBackgroundColorstring
idstring
name*stringRegExp
onBack() => void
onClose() => void
scrollOffsetnumber
showCloseButtonboolean
styleCSSProperties
subtitlestring
titlestring
titleAlignment"center""left"
zIndexnumber

Undocumented props

NameTypeDefault ValueDescriptionUsage count
refany
Edit this page
Previous
Frame
Next
LegacyTable
  • Opening
  • Accessible name
  • Closing
  • Footer
  • With steps