Button
Buttons trigger an event such as screen navigation or an action applied to selected items.
Also known as: call to action, CTA, ghost button, link button, primary button, quiet, secondary button, tertiary button
Type
Permalink to "Type"Solid
Permalink to "Solid"Solid buttons visually guide users to the primary action we want them to take.
<bolt-button type="solid">Button label</bolt-button>
Outline
Permalink to "Outline"Outline (a.k.a., "standard") buttons are often placed in close proximity of the primary action button.
- Standard buttons should be used for actions that apply to the entire screen, such as canceling changes a user has made.
<bolt-button>Button label</bolt-button>
Ghost
Permalink to "Ghost"Ghost (a.k.a., "contextual inline") buttons should be used for triggering actions that take place on the current screen, such as removing an item from a list.
<bolt-button type="ghost">Button label</bolt-button>
State
Permalink to "State"<bolt-button disabled>Button label</bolt-button>
Color
Permalink to "Color"Default color
Permalink to "Default color"The default button color automatically adapts to both local background context and global theme.
<div class="bolt-background-darkBlue">
<bolt-button>Button on dark blue</bolt-button>
</div>
Theme colors
Permalink to "Theme colors"Theme colors adjust with the global theme to preserve a semantic hierarchy of color options, while ensuring minimum contrast ratios.
They can safely be used on any theme surface color, but should not be used on static background color contexts.
<bolt-button color="primary">Primary</bolt-button>
<bolt-button color="secondary">Secondary</bolt-button>
<bolt-button color="tertiary">Tertiary</bolt-button>
Static colors
Permalink to "Static colors"Static button color options should be chosen in accordance with brand standards and contrast minimums.
<bolt-button color="darkMint">Dark mint button</bolt-button>
Layout
Permalink to "Layout"Size
Permalink to "Size"<bolt-button size="sm">Small button</bolt-button>
<bolt-button>Medium button</bolt-button>
<bolt-button size="lg">Large button</bolt-button>
Width
Permalink to "Width"By default, a button's width is based on its content. A full-width button takes up the entire width of its container. Additional responsive options based on grid breakpoints can be used to create full-width buttons that revert to content-width at the specified screen size and above.
<bolt-button width="full-sm">width="full-sm"</bolt-button>
<bolt-button width="full-md">width="full-md"</bolt-button>
<bolt-button width="full-lg">width="full-lg"</bolt-button>
<bolt-button width="full-xl">width="full-xl"</bolt-button>
<bolt-button width="full">width="full"</bolt-button>
Optional features
Permalink to "Optional features"Icon
Permalink to "Icon"Icons on buttons should be used sparingly, and should typically appear on the left side of a button.
<bolt-button iconleft="print">Print</bolt-button>
<bolt-button iconleft="search" arialabel="Search this page"></bolt-button>
Badge
Permalink to "Badge"Badge on buttons indicate one or more notifications are available. This should be used to indicate the button needs the user's attention. The badge will appear in the top right of the button.
<bolt-button type="solid" badgecount="3">Notification Button</bolt-button>
Syntax
Permalink to "Syntax"<bolt-button
[arialabel="..."]
[arialabelledby="..."]
[badgecolor="..."]
[badgecount="..."]
[color="..."]
[datatestbutton="..."]
[disabled]
[href="..."]
[iconleft="..."]
[iconright="..."]
[size="..."]
[submit]
[target="..."]
[type="..."]
[width="..."]
...
>
<!-- (optional) text label goes here -->
</bolt-button>
Properties
Permalink to "Properties"In addition to global HTML attributes, the <bolt-button> custom element supports the following properties.
- arialabel (optional)
- Sets the
aria-labelattribute of the underlying<button>element. - Has no effect on "link" buttons.
- Sets the
- arialabelledby (optional)
- Sets the
aria-labelledbyattribute of the underlying<button>element. - Has no effect on "link" buttons.
- Sets the
- badgecount (optional)
- Configures the number count shown on the badge.
- Values:
1 ≤ badgecount- A minimum value of
1is required for the badge to appear. - Values below
2are not shown on the badge.
- A minimum value of
- badgecolor (optional)
- Sets the badge color.
- Values:
darkerror(default)light
- color (optional)
- By default, automatically adapts to contextual theme and global theme to ensure accessible contrast.
When configuring button color, designers are responsible for meeting brand standards and contrast minimums.
- Theme
- Theme colors dynamically update with the global theme.
- Provides a consistent hierarchy of accent colors that work in both light and dark mode.
- Values:
primarysecondarytertiary
- Static
- Static colors are neither thematically nor contextually aware and will remain their configured color, regardless of global theme or theming context.
- Certain values are intended to be use on a light or dark background.
- See "Button color" design guidelines for more info.
- Values:
charcoaldarkMintlightBluemintvibrantBluewhite
- By default, automatically adapts to contextual theme and global theme to ensure accessible contrast.
- disabled (optional)
- Boolean flag used to disable the button.
- href (optional)
- Sets a URL to navigate to when the button is clicked.
- This should only be used if the button is being used as a link.
- iconleft (optional)
- Icon to display on the left side of the button.
- see Iconography for supported icons
- iconright (optional)
- Icon to display on the right side of the button.
- see Iconography for supported icons
- size (optional)
- The size of the button.
- See "Button size" design guidelines for more info.
- Values:
smmd(default)lg
- The size of the button.
- submit (optional)
- Boolean flag to enable form submission on click.
- If present, modifies element behavior to act like a
<button type="submit">, so that it triggers<form>submission when clicked. - Has no effect on "link" buttons.
- target (optional)
- Passed through to underlying
<a target="...">configuration. - Only affects "link" buttons.
- Values:
_self(default)_blank- Use if button link is expected to open URL from
hrefvalue above in a new window.
- Use if button link is expected to open URL from
- Passed through to underlying
- type (optional)
- Overrides the button style.
- See "Button types" design guidelines for more info.
- Values:
ghostoutline(default)solid
- Overrides the button style.
- width (optional)
- Values:
full(always full width of parent container)full-smfull-mdfull-lgfull-xl
- Values with a breakpoint suffix will apply button sizing at specified screen size and smaller (similar to conventions used in the Grid component).
- Values:
Icon-only button
Permalink to "Icon-only button"<bolt-button
[iconleft="..."]
[iconright="..."]
...
></bolt-button>
(It must match the CSS
:empty pseudo-class.)
- To configure the icon, you may use either the
iconleftoriconrightattribute, but not both. - You will need to make use of either the
arialabelorarialabelledbyproperty to configure an accessible label for the button.
Internals
Permalink to "Internals"Test selectors
Permalink to "Test selectors"[data-test="button"]- Targets the primary interactive element.
- Value is configurable via the
datatestbuttonproperty
Known issues
Permalink to "Known issues"- In Angular applications, adding the
routerLinkdirective to a<bolt-button>results intabindex="0"being applied, making the button receive focus twice.- This is a known issue with how Angular's
routerlinkworks. - A workaround is to implement a
(click)handler that performs arouter.navigate()instead.
- This is a known issue with how Angular's
General guidelines
Permalink to "General guidelines"- Buttons provide a clear and intuitive way for users to interact with an application or website.
- Buttons are used to communicate and trigger actions users can take in an interface.
- Prioritize and emphasize the most important action in a page by making it the singular preferred Button.
- Buttons should be grouped visually, with destructive actions spatially separated from preferred actions as much as possible.
- Do not disable a Button if there's even a small chance users do not understand what to do to enable it. It is an industry best practice and Nationwide's standard to allow a user to always be able to press a Button in an interface. This allows the user to receive messaging informing them what they can do to fix an issue rather than letting them struggle to figure out what they can do to enable the Button.
Button types
Permalink to "Button types"- The use of Solid, Outline, and Ghost Button types help create a clear visual hierarchy, making it easier for users to understand which actions are most important. This hierarchy guides users through the interface, ensuring they can quickly identify and complete key tasks.
- Place a single Solid, preferred action Button, at the end of a button group.
- Use Outline Buttons for multiple actions of equal importance.
| Type | Visual | Description |
|---|---|---|
| Solid | Fill only, no outline.
Used for actions that are the preferred action for a user to take (e.g., "Place order") |
|
| Outline (default) | Outline only, no fill
For actions that support the preferred action, but less visually prominent (e.g., "Apply coupon") |
|
| Ghost | No outline, no fill
Used for optional actions that users can take – much less prominent to users (e.g., "Continue shopping") |
Using icons in Buttons
Permalink to "Using icons in Buttons"- Consider adding an Icon to a Button triggering actions without navigation, (e.g., "Print").
- A label should be included when using an Icon in a Button, if possible.
- Only use an Icon in a Button that clearly communicates its meaning.
- Icons in Buttons should not be used to imply directionality.
Icon-only Buttons
Permalink to "Icon-only Buttons"- Icon-only Buttons should be reserved for:
- when the Icon is easily understood by an average user or has been widely standardized, such as the icons used for airport and subway signs.
- when screen real estate is at a premium.
- Example: using a Button with a printer Icon and the word "Print" on desktop that changes to a Button with only the printer Icon on a smaller screen (e.g. phone).
Button size
Permalink to "Button size"- Choosing the right Button size depends on the context and the importance of the action.
| Size | Visual | Description |
|---|---|---|
| Large | When there is only one most important action for a user to take (e.g., an email, or a Sales page with one CTA). | |
| Medium (default) | Standard Button size, used in almost all instances. | |
| Small | Used for less critical actions or when space is limited. |
Button color
Permalink to "Button color"- The use of primary, secondary, and tertiary colors helps in creating a visual prominence to Button hierarchy.
| Color | Visual | Description | |
|---|---|---|---|
| Global theme aware | |||
| Primary | Used for the most preferential or important actions. Uses a color that stands out against the background and other elements on the page. |
||
| Secondary | Used for actions that are important but not as critical as primary actions. Uses a color that complements the primary color but does not compete with it for attention. |
||
| Tertiary | Used for the least important actions, often optional or less frequently used. Uses a color that minimizes distraction. |
||
| Global theme & context aware | |||
| Auto (default) | Automatically finds the highest contrast color based on background class and global theme. | ||
When to use
Permalink to "When to use"- When progressing or regressing a user through the steps in a flow.
- When indicating actions of high priority.
- To draw attention or highlight a preferred call to action.
When not to use
Permalink to "When not to use"- Refrain from using Buttons for in-page navigation (e.g, anchor links) or for navigation to another site; instead use Link.
- When text within a paragraph is used to navigate to another page, use a Link.
- Consider using Checkbox, Switch, or segmented controls for toggleable states.
Do
- Use clear, concise, descriptive labels for Buttons with clear active verbs.
- Use established Button colors.
- Prioritize the most important actions.
- Position Buttons consistently in the interface.
Don't
- Don't use more than one Solid, preferred action, Button in a Button group.
- Don't give supportive actions the same visual weight as preferred actions.
- Don't disable Buttons in a flow.
- Don't use long or redundant labels.
- Don't place Buttons in a disabled state on a red background.
- Don't use colors outside of those documented.
- Don't mix different colors of Buttons in the same group.
- Don't remove or override the default focus styles on a Button.
Content guidelines
Permalink to "Content guidelines"- Use sentence case for Button labels.
- Button labels should be as short as possible and include "trigger words" that clearly explain the singular action that will take place when the Button is clicked, such as "Download" or "View."
- Consider leading with a strong, actionable verb.
- Don't use vague terms like "button", "Click Here", "more", "click for details" when labelling a Button.
- Avoid using the same label for multiple Buttons on the same page.
- Maintain consistency with terms and language.
Accessibility compliance
Permalink to "Accessibility compliance"-
WCAG 2.2 Compliant
-
JAWS 2025 Tested
-
NVDA 2025 Tested
-
VoiceOver Tested
-
Keyboard Tested
-
aXe Tested
Best Practices
Permalink to "Best Practices"- The
arialabelattribute will override ARIA attributes of child components.- If
arialabelis defined, ARIA attributes of children will have to manually added (e.g. badge).
- If
Built-in behavior
Permalink to "Built-in behavior"Disabled buttons
Permalink to "Disabled buttons"- When applying the
disabledattribute to<bolt-button>, the underlying<button>element is semantically disabled.- Disabled buttons are removed from the tab order, and cannot receive keyboard focus.
- Disabled buttons can still receive screen reader focus, and can be accessed by screen reader navigation controls such as the arrow keys.
Known issues
Permalink to "Known issues"In Angular applications, adding a routerLink to a button results in tabindex="0" being added to it, making the button receive focus twice. This is a known issue with how Angular's routerlink works. A workaround is to implement a @click handler that performs a router.navigate() instead.
All Bolt components have gone through accessibility testing, but please keep our accessibility guidelines in mind.