What keyboard functions need to be compatible with a button?

Question

I was told that my buttons need to be operable by the spacebar. Is that true? Are there any other keys that need to be supported?

Answer

Yes, buttons should be operable by the spacebar. If you use a <button> element, it will natively support both return/enter and spacebar activation. If you create a button another way (such as with a <div>), you will need to do additional work to ensure the spacebar can be used. 

The Keyboard Interaction section of the Button ARIA design pattern also has requirements for focus management, depending on the function of the button.

Free Tools to Continue Learning

Accessible Web Company Logo

Accessible Web RAMP

Monitor your website and manage your progress towards WCAG conformance.

Accessible Web Company Logo

Accessible Web Academy

Career specific courses to help power up your accessibility knowledge.