UI components

Buttons

Use buttons to signal actions.

Primary Buttons
Secondary Buttons
Button Focus
Disabled Button
Big Button
  • 
      <h6>Primary Buttons</h6>
      <div class="button_wrapper">
        <button>Default</button>
        <button class="usa-button-active">Active</button>
        <button class="usa-button-hover">Hover</button>
      </div>
      <div class="button_wrapper">
        <button class="usa-button-primary-alt">Default</button>
        <button class="usa-button-primary-alt usa-button-active">Active</button>
        <button class="usa-button-primary-alt usa-button-hover">Hover</button>
      </div>
    
      <h6>Secondary Buttons</h6>
      <div class="button_wrapper">
        <button class="usa-button-secondary">Default</button>
        <button class="usa-button-secondary usa-button-active">Active</button>
        <button class="usa-button-secondary usa-button-hover">Hover</button>
      </div>
    
      <div class="button_wrapper">
        <button class="usa-button-gray">Default</button>
        <button class="usa-button-gray usa-button-active">Active</button>
        <button class="usa-button-gray usa-button-hover">Hover</button>
      </div>
    
      <div class="button_wrapper">
        <button class="usa-button-outline" type="button">Default</button>
        <button class="usa-button-outline usa-button-active">Active</button>
        <button class="usa-button-outline usa-button-hover">Hover</button>
      </div>
    
      <div class="button_wrapper button_wrapper-dark">
        <button class="usa-button-outline-inverse" type="button">Default</button>
        <button class="usa-button-outline-inverse usa-button-active">Active</button>
        <button class="usa-button-outline-inverse usa-button-hover">Hover</button>
      </div>
    
      <h6>Button Focus</h6>
      <div class="button_wrapper">
        <button class="usa-button-focus">Default</button>
        <button class="usa-button-primary-alt usa-button-focus">Default</button>
        <button class="usa-button-secondary usa-button-focus">Default</button>
      </div>
    
      <h6>Disabled Button</h6>
      <div class="button_wrapper">
        <button class="usa-button-disabled" disabled>Default</button>
      </div>
    
      <h6>Big Button</h6>
      <div class="button_wrapper">
        <button class="usa-button-big" type="button">Default</button>
      </div>
    
    
    

Implementation

The examples demonstrate how to use button elements. To use a button style on an anchor link, add the usa-button class to your anchor link.

To use a different style button on your anchor link, add the special button class in addition to usa-button:

  • usa-button-primary-alt
  • usa-button-secondary
  • usa-button-gray
  • usa-button-outline
  • usa-button-outline-inverse
  • usa-button-disabled
  • usa-button-big

For example, a secondary button style would use the following code: <a class="usa-button usa-button-secondary" href="/my-link">My button</a>

Accessibility

  • Buttons should display a visible focus state when users tab to them.
  • Avoid using <div> or <img> tags to create buttons. Screen readers don’t automatically know either is a usable button.
  • 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.

Usability

When to use
  • 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
  • If you want to lead users between pages of a website. Use links instead.
  • Less popular or less important actions may be visually styled as links.
Guidance
  • Generally, use primary buttons for actions that go to the next step and use secondary buttons for actions that happen on the current page.
  • Style the button most users should click in a way that distinguishes from other buttons on the page. Try using the “large button” or the most visually distinct fill color.
  • Make sure buttons should look clickable—use color variations to distinguish static, hover and active states.
  • Avoid using too many buttons on a page.
  • Use sentence case for button labels.
  • Button labels should be as short as possible with “trigger words” that your users will recognize to clearly explain what will happen when the button is clicked (for example, “download,” “view” or “sign up”).
  • Make the first word of the button’s label a verb. For example, instead of “Complaint Filing” label the button “File a complaint.”
  • At times, consider adding an icon to signal specific actions (“download”, “open in a new window”, etc).