Modals in SolidJS
Is there some proper way implementing modals in solid?
I have a special button component and I want to open a modal on clicking this button.
I read something about
Portal
. Can you help me here :)?
What would you do? Best Practice?3 Replies
Modals are a bit of a challenge for sure. The
<Portal />
element is what you are looking for mixed with some absolute positioning. But if you want the easiest way to implement a modal with all the best practices taken care of I highly recommend checking out https://kobalte.dev/docs/components/dialogUnknown User•2y ago
Message Not Public
Sign In & Join Server To View
The solid-bootstrap modals are also easy to use:
https://solid-libs.github.io/solid-bootstrap/components/modal