steven-tey / precedent

An opinionated collection of components, hooks, and utilities for your Next.js project.
https://precedent.dev
MIT License
4.69k stars 409 forks source link

<dialog> element for modals! #5

Closed mehulkar closed 1 year ago

mehulkar commented 1 year ago

<dialog> element is widely available now! I would recommend using it for modals :) https://github.com/steven-tey/precedent/blob/main/components/shared/modal.tsx

kylemh commented 1 year ago

https://www.oidaisdes.org/native-dialog-element.en/ not quite ready for the big time.

steven-tey commented 1 year ago

I remember trying to do this with https://github.com/steven-tey/dub but for some reason <dialog> + framer-motion was throwing some weird bugs...will take another stab!

steven-tey commented 1 year ago

Update: yup, changing motion.div to motion.dialog breaks the modal 😅

CleanShot 2023-01-14 at 19 14 51@2x

Might fix it if I have time but probably not a top priority for now