<><dap-ds-buttononclick="document.getElementById('tray-bottom').open=true">Open Modal</dap-ds-button><dap-ds-modalid="tray-bottom"><dap-ds-typographyvariant="h1"slot="title">Like a tray?</dap-ds-typography><p>Opened like a tray</p><dap-ds-buttonslot="footer"onclick="document.getElementById('tray-bottom').open=false">I like tray</dap-ds-button><dap-ds-buttondangerslot="footer"onclick="document.getElementById('tray-bottom').open=false">I don't ike tray</dap-ds-button></dap-ds-modal></>
Events
Modal has many events according to its state. You can listen to these events to trigger some actions.
Most important event is the dds-close event, which is triggered when the modal is closed.
The events detail properry contains the source of the event. This can be ok-button, cancel-button, close-button, overlay, or esc.