Style

A button is clickable text or an icon that triggers an action on the page or in the background. Depending on the action, content, and hierarchy, a button can be used on its own or grouped with other buttons.

Anatomy

 Anatomy image of buttons with numbered annotations
  1. Text
  2. Container
  3. Border
  4. Text only
  5. Icon
  6. Icon background
  7. Icon only

Theme

Buttons are available in both light and dark themes.

Light and dark themes

 Image of light theme Danger, Primary, Secondary, Tertiary, Link, Play, and Close buttons
 Image of dark theme Danger, Primary, Secondary, Tertiary, Link, Play, and Close buttons

Configuration

All buttons with a container have the same height and border radius, but the width varies based on the amount of content. Buttons in a row are all horizontally centered. When a Play button is placed on an image, it is both horizontally and vertically centered and stays the same size no matter how big or small the image gets.

 Image of buttons and various specs like border radius, height, icon size, width, alignment, placement, and more

Space

Space values are the same on all breakpoints for the following buttons. To see space values when buttons are grouped, go to the Guidelines page.

Helpful tip

Buttons include a custom 6px spacer, do not use it anywhere else.

 Image of Danger, Primary, Secondary, Tertiary, Link, and Close buttons with spacing values in between
Example Token Description
6 --rh-space-sm 6px spacer
8 --rh-space-md 8px spacer
16 --rh-space-lg 16px spacer

Interaction states

Interaction states are visual representations used to communicate the status of an element or pattern.

Hover

 Image of light theme button hover states
 Image of dark theme button hover states

Focus

Helpful tip

The Focus state has the same styles as the Hover state.

 Image of light theme button focus states
 Image of dark theme button focus states

Active

Helpful tip

The Active state has the same styles as the Hover state.

 Image of light theme button active states
 Image of dark theme button active states
© 2021-2024 Red Hat, Inc. Deploys by Netlify