hypra

A11Y-004: action has no label

Error: the page doesn't build until this is fixed.

An action becomes a button, and its text is the button's label. Without it, people see an empty button, screen readers announce just "button", and AI agents get a tool with no description.

Fails

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action("cart.add", id: 42)
}
error[A11Y-004]: action has no label
 --> page.hypra:3:3
  |
3 |   action("cart.add", id: 42)
  |   ^^^^^^
  = help: add the button text: action("cart.add") "Add to cart"
  = docs: https://hypralang.dev/rules/a11y-004/

1 error, 0 warnings

Fixed

page(title: "Shoes", description: "All our running shoes, from light racers to trail shoes.") {
  h1 "Shoes"
  action("cart.add", id: 42) "Add to cart"
}