Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

More or less the same as a regular page - use aria labels, update names and titles of elements, make sure the focus is set correctly, etc.


And try to be frugal on the tags you make.

Component design is the enemy here. Just take a peak at the nav elements in many designs and see how embedded the divs go.


Screen readers don't read the hierarchy of elements back to you. They find the text that renders inside the elements and read it out loud to you. And for navigating between elements, the level of nesting is much less relevant than having the correct aria-role assigned to each element that contains an interactive component.


Fair. My experience has been that these labels are typically afterthoughts and at a simplistic level don't offer much over the markup. :(


Are you referring to styled-components and the like? What is exactly the problem with that?*

* except media queries, those seem hard


Many prebuilt component libraries design for maintenance and all possible uses over being frugal. The actual markup can get really ugly with i.e. MUI.

When you put in the effort to build the components yourself, you aren't trying to be everything for everyone, so you get to skip a lot of the cruft.


Exactly this. Is a large reason to not try to build the most general components, either. Build what you need, where you can.

That all said, I also have to ack that the libraries are going to be hard to beat for speed of delivery. :(


To be honest, I think people tend to overestimate just how long it takes to make a nice looking button or write some flexbox styling. Even standard form components are really not too time consuming to style.

What pushes me towards using third party code is stuff like autocomplete search with drop-down selects, mostly because I don't want to mess up on the accessibility front, either keyboard navigation or screen readers, and there's at least a few that have that part figured out already.


The idea of components is fine. I should have been clear, there. The problem typically comes from the authoring tools. To have the hooks necessary to put the decoration that we want, in html, they typically add a ton of div elements. When, realistically, you could almost certainly get what you want with very minimal markup.

And being fair, I'm sure this has gotten a bit better in recent years. But the Rube Goldberg efforts people would put in to get the "flow" of the browser to automatically place things in locations that were easily calculated is frustrating.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: