Icon-Only Button Template

Save space and provide intuitive controls with this set of clean, icon-only buttons.

These buttons are essential for user interfaces that require compact actions, such as settings toggles, item deletions, or editing functions.

Screenshot of small, compact buttons that only use icons.

Get Source Code Preview

About Icon-Only Buttons

Icon-only buttons are a staple of modern UI design, used when an action's meaning can be conveyed effectively by a symbol alone. They help to de-clutter interfaces and are especially useful in toolbars or next to items in a list. Because they lack visible text, making them accessible is a top priority. This template shows how to create them accessibly for all users.

Features

Code Breakdown

The buttons are styled to be circular and use Flexbox to perfectly center the icon within. The most important part of the HTML from an accessibility perspective is the aria-label on each button. Without it, the buttons would be confusing or completely unusable for screen reader users. The SVG icons inside are given aria-hidden="true" because their purpose is purely decorative; the accessible name is already provided by the parent button's aria-label.

Code

Here is the complete code for the accessible icon-only buttons.

View Output