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

I would argue that frontend libraries like htmx and React are not the place to build in ARIA attributes patterns/behaviours. In fact, none of the Big Ones do anything specifically w.r.t. announcing changes. See https://news.ycombinator.com/item?id=42625070

What would be the appropriate place, imho, would be component frameworks that are built on top of htmx. FastHTML is an example; they already have htmx integration and they talk about server-side components. If we look at a popular one in React, this is what they do: https://blog.logrocket.com/aria-live-regions-for-javascript-...

Thinking about it in terms of dream-html[1], it might look like:

    let announce msg =
      p [
        class_ "announcement";
        Hx.swap_oob "innerHTML:.announcement";
        Aria.live `polite;
      ] [txt "%s" msg]

    (* POST /purchase *)
    let purchase request =
      let thank_you_fragment = ... in
      Dream_html.respond (
        (* Join fragments together *)
        null [
          thank_you_fragment;
          announce "Your purchase has been successful!";
        ]
      )

[1] https://github.com/yawaramin/dream-html



Consider applying for YC's Fall 2025 batch! Applications are open till Aug 4

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

Search: