Overlay

Overlay component is a web component that displays a overlay on top of the content.

Examples Deafult overlay

An overlay is a bit hard to demonstate in a static example, but here is a simple example of how to use it. By default the overlay is not visible, but you can set the open attribute to true to make it visible.

<>
<dap-ds-button onClick={
  () => {
    const overlay = document.querySelector('dap-ds-overlay');
    overlay.open = !overlay.open;
  }
}>Open Overlay</dap-ds-button>
<dap-ds-overlay onClick={
  () => {
    const overlay = document.querySelector('dap-ds-overlay');
    overlay.open = !overlay.open;
  }
}></dap-ds-overlay>
</>
Importing
import { DapDSOverlay } from 'dap-design-system/dist/dds'
Importing React
import { DapDSOverlayReact } from 'dap-design-system/dist/react'
Attributes
PropertyTypeDefaultDescription
openboolean, undefinedThe open state of the overlay.
Slots

No slots available.

Events

No custom events available.

CSS Parts
Part NameDescription
overlayThe overlay element
CSS Custom Properties
Property NameDescription
--dds-overlay-z-indexControls the z-index of the overlay (default: 1)
--dds-overlay-background-colorControls the background color of the overlay (default: var(--dds-black-10))
--dds-overlay-opacity-closedControls the opacity when overlay is closed (default: 0)
--dds-overlay-opacity-openControls the opacity when overlay is open (default: 1)