Toggle theme

React Overlay🔗

@volvo-cars/react-overlay

@volvo-cars/react-overlay
@volvo-cars/react-overlay
@volvo-cars/react-overlay

Installation🔗

💡 This package includes Typescript definitions


TitledOverlay🔗

Renders an accessible modal box with a titled header, integrated close button and a scrollable content area. Can be displayed fullscreen or constrained to a grid colSpan. When displayed constrained, a dark semi-opaque background covers the background content.

The TitledOverlay will trap focus on mount and release it on unmount.

The ref is forwarded to the root element.

Name
Description
Type
Default Value
childrenContent to be wrappedReact.ReactNodeundefined
closeFunction to be invoked on click of the close icon in the header() => voidundefined
titleTitle to be rendered in the modal headerstringundefined
colSpanOptional. If empty, modal will render fullscreennumberundefined
elementIdOptional. If empty, a unique identifier will be generated for youstringundefined
minimisableTitleOptional. If true, Title will render large and decrease in size on scrollbooleanfalse
navPreviousPaneOptional. If provided, a back arrow will be rendered in the header block() => void)undefined
zIndexOptional. Custom zIndex for use in cases of conflict with other absolutely positioned elementsnumberundefined

Overlay🔗

Renders an accessible modal box with a integrated close button and a scrollable content area. Can be displayed fullscreen or constrained to a grid colSpan. When displayed constrained, a dark semi-opaque background covers the background content.

The Overlay will trap focus on mount and release it on unmount.

The ref is forwarded to the root element.

Name
Description
Type
Default Value
childrenContent to be wrappedReact.ReactNodeundefined
closeFunction to be invoked on click of the close icon in the header() => voidundefined
colSpanOptional. If empty, modal will render fullscreennumberundefined
zIndexOptional. Custom zIndex for use in cases of conflict with other absolutely positioned elementsnumberundefined

ContentBlock🔗

The TitledOverlay makes no assumptions about the content you wish to render within the modal box. However, we do export a ContentBlock component to wrap your content which will maintain DLS compliance for responsive content width and paddings and this should almost always be used.

Name
Description
Type
Default Value
childrenContent to be wrappedReact.ReactNodeundefined
parentDimensionsAutomatically passed when the first child of TitledOverlay.Dimensionsundefined

Examples🔗

Demo implementations can be found in the Storybook

2022 © Volvo Car Corporation