<Modals />
Responsible for rendering the current stack of modals.
Props
Modals can receive the following props (which are currently all just snippets):
Snippets
backdrop
Renders when at least 1 modal has been opened.
modal
Renders each modal component in the stack
loading
Renders when a modal has been opened via dynamic import and is still loading.
Advanced Usage
Always show all modals
By overriding the modal
snippet, you can change the behavior of the stack
to always show each opened modal.
Notice how clicking “close” on a modal in the background will close that modal
rather than the one on the top. This is because these modal components
use the close()
prop, which will dismiss that modal specifically.
You can also close a modal by using modals.closeById(id)
and passing an id to the modal.