Overlaypolymorphic
Overlays given element with div element with any color and opacity
Import
Source
Docs
Package
Usage
Overlay has absolute position and will take 100% of width and height of parent container. It is used to build components like Modal and LoadingOverlay.
You can change overlay opacity (from 0 to 1), color (CSS color value, not connected to Mantine theme) and z-index (number).
With gradient
With blur
To blur the overlay backdrop, set the blur prop with a number. This will set the backdrop blur in px.
Note that blur is not supported in Firefox.
Overlay with a blur.
Polymorphic component
Overlay is a polymorphic component, you can change root element:
Overlay component props
| Name | Type | Description |
|---|---|---|
| blur | number | Overlay background blur in px |
| color | BackgroundColor | Overlay background-color |
| gradient | string | Use gradient instead of background-color |
| radius | number | "xs" | "sm" | "md" | "lg" | "xl" | Value from theme.radius or number to set border-radius in px |
| zIndex | ZIndex | Overlay z-index |