Names and announcements
Every control has a name that screen readers read, and IzzyBlazor requires one wherever WCAG or ARIA does. When something changes without a full reload, such as a filtered count, a saved form or a new toast, the change is announced.
Labels on fields
Every field renders a label linked to its control, and links its hint and errors with
aria-describedby. The label comes from Label. Without it, the label comes from the
model property's [Display] or [DisplayName] name, or else from the property's name
split into words (FirstName becomes "First name"). To hide the label but keep it for screen readers, set
HideLabel.
Components that require a name
These components throw an exception on their first render when their name is missing, so you notice at once. Most of them show only an icon or a picture, with no text for a screen reader to read:
| Component | Requires |
|---|---|
| IconButton | Label |
| FloatingButton | Label |
| SpeedDial | Label, and a Label on each SpeedDialAction |
| SplitButton | Label |
| ToggleButton | Label when IconOnly |
| Image | Alt, or Alt="" for a decorative picture |
| QrCode | Label, or Decorative when the text beside it describes it |
| Chart and every other chart | Title, or TitledBy to name it with your own heading |
| Sparkline | Label |
| Gauge, LinearGauge | Label, and a Label on each GaugePointer |
| Stat with a Sparkline | Label or SparklineLabel |
| Carousel | Label |
| Chat | Label |
| Collapsible | Label, or your own Trigger |
| FilterSelect, FilterCheckbox, FilterDate | Label |
| Menu | Label for its button, or your own Trigger |
| Popover | Label for its button, or your own Trigger |
| ContextMenu | Label |
| MenuSub | Label |
| Tab | Label |
| TabLink | Label |
| Card with Href | Title, which becomes the link text |
| ColumnBand | Title |
| Tile in an Editable TileLayout | Title or Label, which names its Move handle |
Where ARIA makes a name optional, so does IzzyBlazor. Landmarks get a default name from
IzzyText, such as "Breadcrumb" and "Pagination". When a page has two of the
same kind, set Label on each.
Icons and pictures
- An Icon is hidden from screen readers unless you give it a
Label, so it never repeats the text beside it. - An Avatar is read as its
Name. - Alerts and toasts show their status with an icon as well as a color. A
Badge'sStatusis color only, so its text must say what it means. - A chart is named by its
Title, and its Show data table lists every value.
What components announce
- Danger and warning alerts are announced as soon as they appear. Other alerts are announced politely. A
Bannerisn't announced, because it's there when the page loads. To announce one that appears later, setAnnounce. - Toasts are announced politely. Their timers pause while the user hovers over or focuses them. Error toasts stay until the user dismisses them.
- A table's "1–10 of 50" and its filter status are announced when they change. So is every move made with the keyboard or a menu: a DataGrid's rows and columns, a ListView's or DropZoneGroup's items, a PickList's items and a TileLayout's tiles. A CopyButton announces "Copied".
- A combobox announces "No matches", and a carousel announces its new slide. A chat announces "Replying" and then "Reply complete". It reads a message from someone else with the author's name.
- A loading button sets
aria-busy, and screen readers read itsLoadingLabel. ASpinneris read as itsLabel, and aProgressannounces its value. - A PasswordField announces a Caps Lock warning. It also announces when all its requirements are met.
Announcing your own changes
To announce a change the components don't know about, such as a list's new count after a filter, set a
LiveRegion's Text. Screen readers read it each
time it changes. Render the LiveRegion with the page, even while it's empty, because a region that appears with
its text already in it isn't read.
To announce the result of an action, such as "Revoked the invite", call Announcer.Announce. On
static pages, AnnouncerRegion sends the message in
the response to the form post, and a ToastRegion includes an AnnouncerRegion. A redirect drops the
message, so after a redirect, show a toast instead.