What I really wish is that there were something like this built on web components, so I could use it with any framework.
What I really wish is that there were something like this built on web components, so I could use it with any framework.
If you need strict accessibility and date picking, you're either making people enter dates in a masked input field or you're using react-aria. I'm sure there's a few other options out there, but you have to dig long and deep for them.
I found that the React samples on Tailwind UI, and their base component library, cover pretty much angle of accessibility.
I was working on a legacy angular upgrade to React upgrade for my employer and they were concerned I would downgrade their current compliance levels moving to Tailwinds components. I actually ended up drastically improving their compliance levels by following Tailwinds lead, and nothing was lost. For example, moving from font awesome to hero icons allowed for the ability to inject a screen reader only tag into the icon, allowing the screen reader to output an icons function.
And not just those but bigger alternatives like Vue. I've been looking for soemthing as good as Radix UI or React Aria Components or Atlas UI to use with Vue but it's just not there.
Much as I like Vue 3 the ecosystem is winning with React
edit: grammar
I don't know. Maybe I just don't like "ecosystems"
Am I out of touch? What do you do when you have tons of custom functionality and styles? I spent about an year in a huge react only shop and I swear these guys were spending most of their time debugging other people's crappy components. Most of them had your reaction when we talked
Let's take a modal, for example. The easy part is clicking a button and having something show up on top of everything else. But do you…
- make sure screen readers announce it correctly when it's opened?
- make sure it has the correct ARIA attributes?
- trap focus within the modal so that you can't tab to an element in the page behind it?
- allow it to be closed with escape?
- return focus to the correct element when it closes?
These aren't arbitrary requirements I'm making up. The W3C has detailed documentation [1] about how people should be able to interact with these components. It's not something I want to spend my time doing, and frankly when it comes to things like ARIA attributes and screen readers it's not something I'm confident I'll do well. That's why libraries like Radix and React Aria are so valuable. You get rich, accessible components basically for free.
UI libs definitely have their drawbacks, but using headless component libraries like Radix or react-aria with your styling solution of choice gets rid of 90% of the problems they generally have.