Replies: 1 comment
-
Hi @innocenzi, Zag.js is largely framework agnostic, and there's no way we can generate unique IDs that work in SSR environments. That's why we leave it to the userland. The idea you shared broadly inspired us to work on Ark UI, a sister project that consumes Zag.js and provides headless components that do all the heavy lifting for the users by setting a unique ID out of the box. |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
🚀 Feature request
I am wondering if it'd be possible to automatically generate an ID, instead of requiring the user to specify one.
🧱 Problem Statement / Justification
Disclaimer; I haven't used Zag yet. I discovered it a while ago, and only now reading the docs. I like the concept a lot, but reading the docs, I keep seeing the requirement to provide an ID.
I think it would be better if that was optional, so the developer doesn't have to manage it.
✅ Proposed solution or API
In Headless UI, they use a simple
useId
hook internally. Here's an example of how they use it.Beta Was this translation helpful? Give feedback.
All reactions