Re:React Aria: A headless UI component library
by jokull on Friday November 05, 2021 @04:47AM
(#29116824)
"Bring your own UI". You get the behavior from the library but they are completely unstyled or without the component layer where the styles live. Other libraries include Radix and HeadlessUI. Here's a presentation from one of the Radix library authors about how to build dropdowns in React, it serves as a good explainer about what goes into a headless UI library component. https://www.youtube.com/watch?v=lY-RQjWeweo
[ Parent
| on HN ]
Re:React Aria: A headless UI component library
by spyke112 on Friday November 05, 2021 @05:08AM
(#29116945)
Why not just use default html elements?
Re:React Aria: A headless UI component library
by deergomoo on Friday November 05, 2021 @05:39AM
(#29117121)
They’re pretty lacking. <select> is a great example: no searching/filtering, no ability to have styled/multiline text in <option>s, nor anything that’s not plain text (so no SVG iconography for example).
People constantly have to reinvent the wheel to offer fairly basic functionality, so it’s good that there are libraries to handle the behaviour and accessibility side well while supporting whatever visual styles you want to make.
Re:React Aria: A headless UI component library
by jorams on Friday November 05, 2021 @03:14PM
(#29123586)
I feel like a big problem here is that the Getting Started starts with a bunch of code that just... outputs a bare button. Starting with something like a combobox would show much more value.
Re:React Aria: A headless UI component library
by fnordsensei on Friday November 05, 2021 @05:13AM
(#29116974)
Some common, but complex, UI components are hard to get right, especially when it comes to accessibility. Combo boxes in particular come to mind.
Re:React Aria: A headless UI component library
by devongovett on Friday November 05, 2021 @11:55AM
(#29121069)
Yeah ComboBox is one of the most difficult. We wrote a post about the work that went into ours. https://react-spectrum.adobe.com/blog/building-a-combobox.ht...