The button is a core interface element — it’s the primary way to indicate interactivity, so it comes in many shapes and sizes. Buttons in a17t are inline flex, so you can fit as much into them as you’d like (and they’ll automatically look nice).
The example buttons on this page are
<span> elements, but the
.button selector can be applied to essentially any type of element. If a button’s element is interactive (e.g., an
<a> with a valid
href attribute), the
:focus state will by default be identical to the
There are low and high priority variants, as well as a large variant (ideal for marketing pages) and a loading variant (great for indicating work happening behind the scenes).
Navigation — Avoid using buttons for navigation. Buttons should generally only be used to perform actions. While that may sometimes mean navigating to a new page (as is the case with a sign-up button), it usually doesn’t. In cases of regular navigation, consider using a portal instead.
Buttons have full tone and priority support.
To make a button “loading,” simply apply the
To make a button large — as we do on a17t’s landing page — simply apply the
Be mindful of all possible states. Not everyone interacts with a button by moving the mouse to click on it. Some use the tab key to select a button visually, and others use non-graphical interfaces entirely. When customizing buttons, remember that the
:hover state does not apply to all cases in which a button is selected.
Don't use color to communicate. Instead, use color to support information you communicate through text. When this isn't possible, be sure to use a
Be mindful of contrast. What looks good to you may not be readable for others. Text contrast is a good thing!
Support all navigation modes. Some people will interact with your interface using assitive technologies and/or a keyboard. Build your interface with these different modes in mind (for example, by setting the `tab-index` attribute on all interactive elements that aren't interactive by default).