Button

A button draws attention to important actions with a large selectable surface.

Maturity level - ready for production

View the React component implementation details and all variants in Storybook.


Component examples

Default


Guidance

When to use the button component

  • Important actions. Use buttons for the most important actions you want users to take on your site, such as Download, Sign up or Log out.

When to consider something else

  • Linking between a site’s pages. Use regular links instead. If the action is less popular or less important. Less popular or less important actions may be visually styled as links.

Usability guidance

  • Use standard buttons for actions that go a next step.
  • Use outline buttons for actions that happen on the current page.
  • Give an important action a distinctive style. Style the button most users should select in a way that distinguishes it from other buttons on the page. Try using the usa-button–big variant or the most visually distinct color variant.
  • Make sure buttons look selectable. Use color variations to distinguish static, hover, and active states.
  • Avoid using too many buttons on a page.
  • Use sentence-case capitalization for button labels.
  • Keep button text short. Button text should be as short as possible with action words that clearly explain what will happen when the button is selected (for example, Download, View, or Sign up).
  • Lead with a verb. Make the first word of the button’s text a verb. For example, instead of Complaint filing, label the button File a complaint.
  • Icons can be helpful. Consider adding an icon to signal specific actions (Download, Open in a new window, etc).

Accessibility

  • Buttons should display a visible focus state when users tab to them.
  • Use standard markup. Avoid using <div> or tags to create buttons. Screen readers don’t automatically know either is a usable button.
  • Screen readers handle buttons and links differently. When styling links to look like buttons, remember that screen readers handle links slightly differently than they do buttons. Pressing the Space key triggers a button, but pressing the Enter key triggers a link.

Using the button component

  • The component preview and component code demonstrate how to use button elements. To use a button style on a link, add the usa-button class to your link.
  • To use a different style button on your link, add button variant classes in addition to usa-button.
  • Use the browser-native disabled attribute for any disabled button. Don’t use usa-button–disabled, which is intended only for debugging and prototyping.
  • Always set the type attribute to define the purpose of the button. The type attribute can accept three values: submit, button, and reset. If no type attribute is defined, the button will behave as a submit button.

Button variants

Variant Description

.usa-card--flag

Display in a horizontal (“flag”) orientation at a specified width.

.usa-card--header-first

Displays the header element before the media element.

.usa-card--media-right

In combination with '.usa-card--flag', sets the media element on the right. (Flag cards display media on the left by default.)

.usa-card__media--inset

Indents the media element so it doesn’t extend to the edge of the card.

.usa-card__media--exdent

Extends the media element out over the card border. Useful for light-bordered cards.

.usa-card__body--exdent

Extends the body element out over the card border. Useful for light-bordered cards.

.usa-card__footer--exdent

Extends the footer element out over the card border. Useful for light-bordered cards.


External References

For the immediate future, please use the react or web components provided by the VA Design System.

For usage and accessibility guidelines please refer to the USWDS.