Transcript#
This transcript was generated automatically and may contain errors.
Shiny for Python 1.9 has introduced sidebar landmarks to support accessibility in screen readers. This sales dashboard has a sidebar called Filters, and if I choose West, the report updates, but a screen reader would need more than just a visual heading to describe what the sidebar does.
In Shiny 1.9, we can give the sidebar a search role. The existing title provides its accessible name. The browser would expose the search landmark named Filters, and screen reader users can navigate to landmarks instead of moving through every control.
If there is no title, we can instead supply an accessible label or label by reference. Shiny rejects a landmark without a name, and you can also set other roles for the sidebar. The default sidebar has no landmark role and uses a div instead. You can set the role to complementary when the sidebar is just supporting content.
You can set the role to complementary when the sidebar is just supporting content.
If you're planning on upgrading your code, note that if you currently use select-aside.sidebar, update it to select.sidebar, or choose the complementary role.
Upgrade Shiny for Python to give this a try today. Choose a role that describes the sidebar, give it a clear name, check the browser's accessibility tree, and ta-da, you've improved your Shiny app's accessibility support. Let us know how it goes.