Precedent – Building Blocks for Next.js
precedent.vercel.app
precedent.vercel.app
It's a good start, but definitely keep it up.
[1] — https://github.com/steven-tey/precedent/blob/main/lib/hooks/... (you don't need the ref if you are ignoring exhaustive-deps, not sure why you stringify threshold)
[2] - https://github.com/steven-tey/precedent/blob/main/lib/hooks/... (you maybe want to check if a key exists and warn before you set it)
[3] - https://github.com/steven-tey/precedent/blob/main/lib/hooks/... (you probably want debounce/throttle options here)
Appreciate the feedback about the functions – will get those fixed as well!
Sorry about that!
[1] https://github.com/steven-tey/precedent/blob/main/components...
[2] https://developer.mozilla.org/en-US/docs/Web/HTML/Element/di...
covers it pretty well.
it's not accessible... yet!
This isn't meant to be a dig at this specific library* (it's certainly no worse than others and you probably did a great job!), but rather the general state of React UI development.
*however this library already uses Framer Motion, which makes such things much easier
I also noticed in `_app.tsx` that you wrapped <Component /> in a <main> element. Wouldn't that wrap the entire app within main tags? I think that kind of throws off the normal flow of accessible landmarks.
I really like the template so far. Might add a few aspects of it to my own. Thanks for sharing
As for the second point – I'm actually not quite sure if there are any downsides/tradeoffs to that. What do you mean by accessible landmarks in this case? a11y?
Glad you like the template!
To use it to bootstrap a new project, you can run:
``` npx create-next-app precedent --example "https://github.com/steven-tey/precedent" ```
https://github.com/steven-tey/precedent/issues/2#issuecommen...
Now the closest thing we have is geist-ui.dev
They hired evilrabbit and now show geist ui on their own site.
Is geist-ui 1-to-1 copy of Vercels?
Surprised they didn’t include a query library. I like the idea of tRPC, but would like to use it on any REST style url.
Did review some html css prior.
Chakra is easy to design with, and fully accessible. Well thought out.
I don't know why this matters. Users certainly don't notice or care. Worrying about it early in the development cycle is a waste of time.
They also have general theming to allow you to quickly get it to look like your brand's colors: https://ant.design/docs/react/customize-theme
FWIW I added css that overrode ant's. It was the simplest and easiest way. It was a step progress component
I also audited their code quite a few times, and they do some very bizarre things in the name of "performance" under the hood.
The under-the-hood stuff also has never bitten me and that's exactly what I want an isolated, composable component to do for me anyway. Performance is excellent.
Once you're comfortable with how react works, then start layering in additional libraries and tools, and get a feel for how they work. You may also find they introduce new pain points that don't work for your particular project. When you're trying to learn everything all at once, it's hard to figure out where a pain point is even coming from.
One of the best things about Next is that it configures everything for you and lets you just start writing some React code and seeing results. I would recommend the GP start with Next, and dig deeper as they go along
Precedent seems a little half-hearted at this point.
That's actually how I learned React myself :)
Disclaimer: I work at Vercel (we maintain Next.js)
Also tailwindui or mui or ant?
[0] https://nextjs.org/learn/foundations/about-nextjs?utm_source...
Highly recommend Radix if you want more components!