Join egghead, unlock knowledge.

Want more egghead?

This lesson is for members. Join us? Get access to all 3,000+ tutorials + a community with expert developers around the world.

Unlock This Lesson
Become a member
to unlock all features

Level Up!

Access all courses & lessons on egghead today and lock-in your price for life.


    WTF are Accessible Design Patterns?

    Erin DoyleErin Doyle

    Although elements that are natively keyboard accessible should be used when possible, there are times when HTML falls short and custom "widgets" are necessary. Complex menus, sliders, dialogs, tab panels, etc. must all be built to support keyboard and screen reader accessibility.

    Widget behavior expectations

    • For more complex widgets there are expectations by keyboard and screen reader users as to how these specific widgets will behave and can be navigated
    • Interactions must be intuitive and predictable
    • Events triggered by mouse clicks should also be able to be triggered via keyboard
    • The state of the widget should always be clear




    Become a Member to view code

    You must be a Member to view code

    Access all courses and lessons, track your progress, gain confidence and expertise.

    Become a Member
    and unlock code for this lesson




    Instructor: While if you search for accessible design patterns or accessible interaction patterns on the Web, you may find a number of guides, but the W3C's Authoring Practices is really the authoritative source for design patterns for accessible widgets.

    If you go to their ARIA practices or Authoring Practices Guide and go to the section on design patterns in widgets, you will find listed a number of UI widgets. You may need to read the description of each to see if what they have defined matches the UI functionality that you're building.

    Once you've located a design pattern that matches what you're looking to build, you find defined a description of the widget, and the parts that make up the widget. They list some code examples for how to implement the widget and these are typically in vanilla HTML, CSS, and JavaScript.

    They will define the expected keyboard interaction behavior, so specific keys for this widget are expected to have certain behavior. They list which ARIA attributes or roles should be added to which parts of the widget and various states or properties those attributes should have for which use cases.

    Typically following all of the requirements defined a design pattern will ensure that that widget is going to be as accessible as possible, and should be compatible with both assistive technology devices as well as keyboard-only users.