| [ Web Proxy ] |
| Viewing: https://shopify.dev/docs/apps/build/accessibility | [Back] [Original] |
When you build an app, make design choices that help keep content accessible. An accessible app is designed so that it can be used by everyone, including people who rely on assistive technology. Accessibility for your app is essential to providing an inclusive experience for app users and customers.
The accessibility best practices for Shopify apps were created with the Web Content Accessibility Guidelines (WCAG) in mind.
There are many factors to consider when creating an accessible app. Following only the best practices on this page doesn't guarantee that your app is completely accessible.
There are many factors to consider when creating an accessible app. Following only the best practices on this page doesn't guarantee that your app is completely accessible.
You can test the accessibility of your app by using tools such as:
When building your app, focus on the main principles of the WCAG 2.0 Guidelines:
Perceivable: Information and UI components must be presentable to users in ways that they can perceive.
Operable: UI components and navigation must be operable.
Understandable: Information and the operation of the UI must be understandable.
Robust: Content must be clear enough that it can be interpreted reliably by a wide variety of user agents, including assistive technologies.
The following sections provide a list of accessibility best practices for how app users and customers interact with your app.
App users and customers who have visual or motor impairments might use a keyboard to navigate and complete tasks online. These users rely on a visual indicator to communicate where their keyboard's focus is on a web page. Your app should allow for all links, buttons, dropdown navigation, and form controls to be controlled using a keyboard.
The following sections provide best practices for specific elements of your app's page structure.
lang attribute is set on the html element to help screen readers pronounce content in the correct accent and dialect.maximum-scale and user-scalable=no attributes.tabindex="-1" on the container for the main content to receive focus.tabindex attributes values other than 0 or -1 and no autofocus attribute. Positive tabindex values in use and autofocus take the power away from the user by forcing a specific focus order. Let the user discover page content organically.h1 to h6) to communicate the organization of the content on the page.h1 element is used to identify the main topic of a page.nav HTML element.aria-current is used to communicate the current page when traversing links.role=menu or role=menuitem aren't used for navigation.aria-expanded is used to communicate the state of collapsible navigation.aria-controls is used to convey to assistive technology that there's a visually-hidden container that the drop-down menu controls.aria-current is used to communicate the current location or page when traversing navigation items.aria-live is used to communicate dynamic changes in the UI.a element is used for links. Your app should use links for navigation, loading a new page, or shifting keyboard focus from one element to another.button element is used for on-screen actions such as launching a modal window and sorting a data table.table element is used for tabular data.caption element is used to help assistive technology identify that a table is being read.th element is used for headers with scope attributes.scope="col" element is used for column headers, and scope="row" for row headers.aria-label, the .visuallyhidden element, floating labels, or a visible label to label forms. Form inputs and controls have names that clearly state their purpose.for attributes, including form labels in the app settings.required attribute.autocomplete attribute. Auto-complete helps people fill in form fields by using the data stored in their browser.aria-describedby attribute is applied to input elements which reference the error text container.aria-live.Media can be distracting, disruptive, or unexpected. All the media in your app should adhere to the following best practices:
prefers-reduced-motion browser setting.img elements should have an alt attribute. Without an alt attribute, screen readers announce the name and path of the image file.alt text which describes the image for screen reader users.alt attributes. Use <img src="/content/assets/images/" alt="" /> to hide images and icons from screen readers.When you add colors to your app's UI, make sure that all of your text is accessible to app users and customers who are colorblind or have other visual impairments. These app users and customers rely on adequate color contrast to visually differentiate one thing from another.
You can use an online contrast ratio tool to check the contrast of the different parts of your app.
The content in your app should adhere to the best practices described in the WCAG 1.4.3: Contrast (Minimum) (Level AA) standards.
Dynamic components such as slideshows, predictive search, modal windows, and tabs can be complex and difficult to navigate. Use elements that can be interpreted by screen readers, provide context, and include keyboard functionality.
dialog.The main consideration for touch screens and mobile devices is to make sure that the app user or customer can easily change the orientation and tap the target to navigate the content.
Touch targets on primary controls and links need to be at least 44 by 44 pixels. Primary touch targets include controls and links such as:
| Web Proxy Viewer | New URL | Original Page |