Overlay component is a web component that displays a overlay on top of the content.
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> </>
import { DapDSOverlay } from 'dap-design-system/dist/dds'
import { DapDSOverlayReact } from 'dap-design-system/dist/react'
Property | Type | Default | Description |
---|---|---|---|
open | boolean , undefined | The open state of the overlay. |
No slots available.
No custom events available.
Part Name | Description |
---|---|
overlay | The overlay element |
Property Name | Description |
---|---|
--dds-overlay-z-index | Controls the z-index of the overlay (default: 1) |
--dds-overlay-background-color | Controls the background color of the overlay (default: var(--dds-black-10)) |
--dds-overlay-opacity-closed | Controls the opacity when overlay is closed (default: 0) |
--dds-overlay-opacity-open | Controls the opacity when overlay is open (default: 1) |