ModalButton
description
- If you return a promise to the close() in the callback, you can make it wait for the dialog to close.
- Please apply the spice__modal_close class to the close button within the content.
- Since it is implemented using a dialog, you can use overscroll-behavior to prevent the background from scrolling even on smartphones. However, scrolling becomes enabled when the nav bar shifts, etc. To avoid this, you should do something like setting the body to 100svh when opening and save and restore the scroll position when opening and closing. In this demo, Lenis is operated according to the state managed globally with zustand.
demo