Tray component is a popup component which can slide in from any side of the screen. It can be used to display additional information or actions.
Design system docsExamplesDefault tray
The dap-ds-tray component is basically a dap-ds-modal component with some specific styling, so all the attributes and events of the dap-ds-modal component are available for the dap-ds-tray component as well.
Default tray is using the open attribute to open or close the tray. Default placement is bottom.
<div><dap-ds-buttonid="open-tray"onClick={()=>document.querySelector('dap-ds-tray').open=true}> Open tray</dap-ds-button><dap-ds-tray><p>Tray content</p></dap-ds-tray></div>
Placement
You can set the placement attribute to top, right, bottom or left to change the direction of the tray.
<dap-ds-stackdirection="row"><dap-ds-buttonid="open-tray"onClick={()=>document.querySelector('#bottom').open=true}> Open bottom</dap-ds-button><dap-ds-trayid="bottom"placement="bottom"><p>Tray content</p></dap-ds-tray><dap-ds-buttonid="open-tray"onClick={()=>document.querySelector('#left').open=true}> Open left</dap-ds-button><dap-ds-trayid="left"placement="left"><p>Tray content</p></dap-ds-tray><dap-ds-buttonid="open-tray"onClick={()=>document.querySelector('#right').open=true}> Open right</dap-ds-button><dap-ds-trayid="right"placement="right"><p>Tray content</p></dap-ds-tray><dap-ds-buttonid="open-tray"onClick={()=>document.querySelector('#top').open=true}> Open top</dap-ds-button><dap-ds-trayid="top"placement="top"><p>Tray content</p></dap-ds-tray></dap-ds-stack>