Skip to main content
Official website. How you know

Official websites use .gov

A .gov website belongs to an official government organization in the United States.

Secure .gov websites use HTTPS

A lock or https:// means you’ve safely connected to the .gov website. Share sensitive information only on official, secure websites.

Digital Design System

Button

Buttons encourage users to take an action. They use text or icons to communicate what will happen after the user engages with the button. They are one of two action components, along with links.

Overview

Primary button

Use the primary button for the action most users should take in a given content area.

Default

Blue oval with white text on top

Hover

Background turns to a dark blue, text remains white

Focus

A dashed line around the default button

Disabled

Light gray oval with a dark gray outline and dark gray text

Secondary button

Use the secondary button for an action that is less common than the primary action. 

Default

White oval with a light gray outline and blue text

Hover

Button text turns to a dark blue, background button remains the same white with gray outline

Focus

A dashed line around the hover button – dark blue text on a white oval outlined in gray

Disabled

Same visual as the disabled primary button, light gray oval with a dark gray outline and dark gray text

Icon button

Use icon buttons when there are severe space restrictions and an icon can effectively communicate the action.

Default

Blue circle with a light gray outline and white icon - example right-facing arrow for Next

Hover

Background turns to a dark blue, icon remains white

Focus

A dashed line around the hover button – dark blue circle with white icon

Disabled

Light gray circle with dark gray outline and icon

Usage context

When to use

Only use buttons to encourage the user to take action online.

Examples of actions include:

  • Beginning an online transaction
  • Submitting information
  • Accessing an application
  • Applying changes in a menu
  • Viewing a specific piece of information

When to use something else

Don’t use a button for these purposes:

  • For the action of navigating to a website or a webpage (use a link instead).
  • For actions that can’t be completed online, such as contacting an office by mail (use a link to the page containing instructions or write them clearly on the page)
  • For content areas with more than two actions, use links for any action beyond the second (after the primary and secondary buttons).

Usage guidelines

Primary and secondary buttons

Button text should be short enough to fit on one line at the button’s maximum width. Button text may wrap onto two lines on smaller displays. If your text is still wrapping at maximum width, shorten it or use a link instead.

Read button content guidance

  • Primary button style with 2 lines of text: Pay parking ticket online & via CityPay
  • Secondary button style with 2 lines of text: Download 2024 form & for property owners

Only use up to one primary and one secondary button in any content area. Use links for further actions.

Mobile view of a page, with primary button Pay ticket online, a secondary button Pay with mobile app, and 2 links Learn how to pay by mail and Learn how to pay in person

Mobile view of a page, with 2 primary buttons Pay ticket online & Pay with mobile app, followed by 2 secondary buttons Learn how to pay by mail and Learn how to pay in person

Primary buttons can stand alone. Secondary buttons must accompany a primary button.

Primary button Check eligibility under a heading of Benefit programs for you, and text You may be eligible for help with food, money, housing, or work.

Same text as last example but now Check eligibility is styled as a secondary button, with no primary button before it


Button group

Button groups contain one primary and one secondary action.

In vertical layouts, the primary button is always closest to the top.

In horizontal layouts, the primary and secondary actions can be placed vertically or side-by-side. Use discretion to determine which arrangement will be most natural to users in context. The action of applying changes or submitting a form is typically in the bottom right.

Primary and secondary buttons are side by side, placed beneath content about parking tickets. Pay Ticket heading, If you received any of the following in NYC… bulleted list, Pay ticket online primary button and Pay with mobile app secondary button

Secondary and Primary buttons are sided by side in the lower right corner of a filter menu. Location heading, close, or select one or more boroughs: checkbox list, Clear selection secondary button, Apply selection primary button.

Primary button

The primary button can be utilized with a button or a element, with the following:

  • Class: button
  • Attribute: data-variant="primary"
This code is for reference only. The library is currently in beta. Check back for future releases.
Link button
<div class="code-examples">
  <button class="button" data-variant="primary">Default</button>
  <button class="button" data-variant="primary" disabled>Disabled</button>
  <a href="#" class="button" data-variant="primary">Link button</a>
</div>

Secondary button

The secondary button can be utilized with a button or a element, with the following:

  • Class: button
  • Attribute: data-variant="secondary"
This code is for reference only. The library is currently in beta. Check back for future releases.
Link button
<div class="code-examples">
  <button class="button" data-variant="secondary">Default</button>
  <button class="button" data-variant="secondary" disabled>Disabled</button>
  <a href="#" class="button" data-variant="secondary">Link button</a>
</div>

Icon button

The icon button can be utilized with a button or a element, with the following attributes:

  • Class: button
  • Attribute: data-variant="icon"
  • Icon element: An icon element should be placed inside the button or link, using an icon font class enabled in the icons package (The package draws from the Iconify: Phosphor Iconset).
This code is for reference only. The library is currently in beta. Check back for future releases.

Default

Disabled

Link Button

<div class="code-examples">
  <div>
    <h4>Default</h4>
    <button type="button" class="button" data-variant="icon"><i class="i-ph:caret-right-bold"></i></button>
  </div>
  <div>
    <h4>Disabled</h4>
    <button type="button" class="button" data-variant="icon" disabled><i class="i-ph:caret-right-bold"></i></button>
  </div>
  <div>
    <h4>Link Button</h4>
    <a href="#" class="button" data-variant="icon"><i class="i-ph:caret-right-bold"></i></a>
  </div>
</div>