Live data from Hacker News

React Aria: A headless UI component library

react-spectrum.adobe.com

41–50 of 73 posts

Re: React Aria: A headless UI component library

#41
post #2

can someone explain in layman terms what is headless UI?

'headless' means you bring your own html structure, the library provides interaction and state exposed by props or hooks. As such, I am not sure Headless UI is headless since they only let you bring your own CSS. At that point, it's a lot easier to create your own set of components that you have full control over than to include another NPM dependency.

Re: React Aria: A headless UI component library

#42

It seems really useful. But the fact that this is useful feels like a code smell in the web platform. It would be cool to go back to HTML=schematics and CSS=styling. Maybe CSS needs to become more capable tool to place divs more easily?

> Maybe CSS needs to become more capable tool to place divs more easily?

What's the issue now then? Flexbox is straightforward enough.

Re: React Aria: A headless UI component library

#44

I haven't gotten into react yet, but am looking at a new project where it might be useful. Out of curiosity, are there drop-in compatible replacements for the standard React libraries, like maybe Preact?

My advice - start with Next.js. Only got started with React myself a year ago (and love it) and to be gone it’s I though, I’ll just stick to nice simple react I bet I don’t need the other stuff. And then, I gradually realised why people use all this other stuff. Next.js solves so many problems!

Re: React Aria: A headless UI component library

#45
post #40

Earlier quoted context omitted.

In what way is Headless UI 'headless'?

It doesn't come with any styling OOTB. The idea is that you're just building a frontend (all the markup, styling etc) around some provided state management

`react-table` is headless. I am forced to create my own html structure and am in control of the markup from the start. `headless-ui` provides those components which doesn't give me full control over markup, does it?

Re: React Aria: A headless UI component library

#46

I haven't gotten into react yet, but am looking at a new project where it might be useful. Out of curiosity, are there drop-in compatible replacements for the standard React libraries, like maybe Preact?

My advice - start with Next.js. Only got started with React myself a year ago (and love it) and to be gone it’s I though, I’ll just stick to nice simple react I bet I don’t need the other stuff. And then, I gradually realised why people use all this other stuff. Next.js solves so many problems!

Not interested in the server-side stuff as I don't use JS/Node on the backend. I see that Next.js is a Node framework, so unless there's a cut down client-side only version that's useful, not sure it'll fit the bill.

I was looking at Alpine.js but it's pretty minimal, so I want something more full-featured to compare to. These headless UIs look useful, and some have React and Vue versions.

Re: React Aria: A headless UI component library

#47

React Aria is a great project! We used it to meet WCAG 2.1 level AA requirements in our chat widget. It's even hard to assess how many days of work we have saved thanks to this solution. We've covered a bit of our experience in multiple posts, e.g. with handling keyboard navigation: https://developers.livechat.com/updates/livechat-accessibili... ).

It is nice that Aria itself gets some attention, since Aria is quite unknown by many people despite its age. It isn't only blind or otherwise disabled people that would profit from controls and content being decently tagged and classified, even if that is the scope of it.

It is however quite extensive as you can see by the role definitions:

https://www.w3.org/TR/wai-aria-1.1/img/rdf_model.png

Don't know if that is still best practice, screen readers probably are way smarter today.

Re: React Aria: A headless UI component library

#48

Earlier quoted context omitted.

My advice - start with Next.js. Only got started with React myself a year ago (and love it) and to be gone it’s I though, I’ll just stick to nice simple react I bet I don’t need the other stuff. And then, I gradually realised why people use all this other stuff. Next.js solves so many problems!

Not interested in the server-side stuff as I don't use JS/Node on the backend. I see that Next.js is a Node framework, so unless there's a cut down client-side only version that's useful, not sure it'll fit the bill. I was looking at Alpine.js but it's pretty minimal, so I want something more full-featured to compare to. These headless UIs look useful, and some have React and Vue versions.

Next.js has `next export` which generates a client-side only bundle. It's really neat, as it saves you a lot of manual setting up and maintenance of configuration files, assuming your app fits in the boundaries of Next.js's use cases - which most do.

Re: React Aria: A headless UI component library

#49

Earlier quoted context omitted.

My advice - start with Next.js. Only got started with React myself a year ago (and love it) and to be gone it’s I though, I’ll just stick to nice simple react I bet I don’t need the other stuff. And then, I gradually realised why people use all this other stuff. Next.js solves so many problems!

Not interested in the server-side stuff as I don't use JS/Node on the backend. I see that Next.js is a Node framework, so unless there's a cut down client-side only version that's useful, not sure it'll fit the bill. I was looking at Alpine.js but it's pretty minimal, so I want something more full-featured to compare to. These headless UIs look useful, and some have React and Vue versions.

While it's true that it's a Node framework, NextJS can totally function like a client-side React framework. NextJS just bakes a lot of basic and common functionality such as routing, built-in support for CSS modules, as well as optimizations (it's not premature if it's baked in already).

The server-side mostly just takes place if you utilize the following: - Built-in API - Server-side Rendering

Re: React Aria: A headless UI component library

#50
post #40

Earlier quoted context omitted.

It doesn't come with any styling OOTB. The idea is that you're just building a frontend (all the markup, styling etc) around some provided state management

`react-table` is headless. I am forced to create my own html structure and am in control of the markup from the start. `headless-ui` provides those components which doesn't give me full control over markup, does it?

It gives you complete control over your markup and styling. Headless UI is designed to handle everything except what the components look like.
Post reply on HN