Next: (hygguile components segmented), Previous: (hygguile components overlay), Up: API
Render a star rating: a group of native radios, or a static score.
In its default (interactive) form the rating is a real radio group, so it works with scripting off and is navigated the way every other choice in a form is: one tab stop, then the arrow keys. Each star carries a spoken name – "3 of 5" – and the group is named by its ‘<legend>‘, which is what a screen reader announces rather than the stars themselves.
With readonly the rating is a single image with an accessible name ("4 out of 5"): the stars are then what a page shows about a score it does not let anyone change, such as an average review score.
The name of the group, rendered as a ‘<legend>‘.
The form field name; the value submitted is the number of stars chosen.
An explicit identifier for the group; defaults to name.
The number of stars that start filled. Defaults to 0.
How many stars there are. Defaults to 5.
Whether a rating has to be given.
Whether the group is disabled.
Show the score without letting it be changed.
Optional helper copy, linked with aria-describedby.
Optional validation message, announced with role="alert".
#t to mark the rating as answered, or a string to say so in
words.
Classes for the field wrapper.
Classes for the legend.
Classes for the helper copy.
Classes for the error message.
Classes for the success message.
(rating #:label "How was your stay?" #:name "score" #:value 4) (rating #:label "Average score" #:name "average" #:value 4 #:readonly #t)
Next: (hygguile components segmented), Previous: (hygguile components overlay), Up: API