Primitives as npm package or copy/pasted? #49
Replies: 4 comments 3 replies
-
Like you said, since this project is still in its early stages, i think it is more efficient to have it as a folder in a sense that it will help for faster updates but also allow customizations. But for those who find it stable enough maybe it's easier to have it as a package, for example i can hardly find a situation where i would like to manually change "radix primitives". So maybe it wouldn't hurt having both methods in the future. |
Beta Was this translation helpful? Give feedback.
-
For sure an npm package. These are supposed to mimic Radix UI Primitives which are npm packages and I don't think anyone has ever had to customize those. I'd also put them in their own package (maybe even repo?) to keep clutter down and focus the responsibility of this project to mostly just the components. This also means people can copy folders directly from the repo since the primitives won't be in the same repo, but rather actually from an npm package. |
Beta Was this translation helpful? Give feedback.
-
New optionA CLI to add components to your projects. It does require you to follow the initial setup before use. Let me know what you think about the CLI ( very early stage) |
Beta Was this translation helpful? Give feedback.
-
Now available as npm packages https://rn-primitives.vercel.app/ 🥳 You can still copy/paste them if you want |
Beta Was this translation helpful? Give feedback.
-
How would you like to add primitives to your project?
Option 1: NPM package
Like ui/shadcn, the primitives would be an npm package that you install in your project so that the code lives in your
node_modules
. This would be one less thing to think about. However, since this project is still in its early stages, fixing bugs would require a patch-package or submitting an issue/pull-request and waiting for the code to be fixed.Option 2: Copy/pasted
Instead of the code living in the
node_modules
folder, you would have a folder calledprimitives
. Like yourui
folder, this is code that you would rarely have to touch. It could be helpful if you want to customize the primitives. For example, you could use a different state manager like redux or zustand. This would also give you the freedom to only add the native primitives if you do not want to use the web primitives.Your experience with ui/shadcn VS react-native-reusables
If you'd like to leave a comment about your experience, here are some topics you could share about:
ui
folder?primitives
hinder your developer experience?29 votes ·
Beta Was this translation helpful? Give feedback.
All reactions