Show or hide content from assistive technologies for canvas apps

In most cases, all users should be able to access all content, but you might occasionally want to show content only to sighted users or only to screen-reader users. For example, you might want only screen-reader users to access descriptions of chart trends that are obvious to sighted users. You might also want to hide an icon from screen-reader users if an adjacent label describes it. Another description on the icon would be unnecessarily verbose.

Hide content from all users

Hide content from sighted users and show it to screen-reader users

Use one or more techniques listed below:

  • Set Size to 0.
  • Set Width and Height to 1.
  • Set X, Y, or both properties such that the control is outside the screen.
  • Set Color and related properties to transparent.
  • Position a rectangle Shape above the content, and set Fill to the same color as the background color of the screen.

Note

Users can still use a keyboard to access an interactive control, such as a Button, even if you hide it by using one of the techniques in the previous list. Set TabIndex to -1 if you want to prevent users from accessing the control by pressing the Tab key.

Hide content from screen-reader users and show it to sighted users

Next steps

Announce dynamic changes with live regions for canvas apps

See also