Bolt Button

Button Component in Bolt

Bolt's Component Explorer is being upgraded. It'll return in a future release!

Button is a branded component to convey call to action. Part of the Bolt “Components” CSS framework that powers the Bolt Design System.

Install via NPM
npm install @bolt/components-button


Buttons are the core of our action components. Their affordance is immediate and can be use for most actions and allow users to access the target with a single interaction. Buttons clearly provide a next step for the user.

Our Buttons depend on the theme they are contained in and change in appearance based on said theme. The themes and button colors were designed together to ensure the proper amount affordance and clarity.

Xlight and light themes

Dark and xdark themes



Overview Usage Schema Edit this page Testing Steps
  {% include "@bolt-components-button/button.twig" with {
  text: "This is a button"
} only %}

Note: when assigning component props as HTML attributes on a web component, make sure to use kebab-case.

Prop Name Description Type Default Value Option(s)

A Drupal-style attributes object with extra attributes to append to this component.

text *

Text inside the button.


Transforms the button text to various cases.

string none
  • uppercase, lowercase, capitalize, none

Determines the button tag type for semantic buttons

  • button, submit, reset

Size of the button.

string medium
  • xsmall, small, medium, large, xlarge

Style of the button determined by information hierarchy.

string primary
  • primary, secondary, tertiary, text

Controls the width of the button.

string auto
  • auto, full, full@small

Rounds the corners of the button.

string regular
  • regular or full

Horizontal alignment of items (text and icon) inside the button. Note: the values left and right are deprecated, use start and end instead.

string center
  • start, center, end

Icon data as expected by the icon component. Accepts an additional position prop that determines placement within the link.

    • position

      Where to position the icon within the button

      • before or after
    • attributes

      A Drupal-style attributes object with extra attributes to append to this component.

    • name

      Icon name

    • background

      Customizes the background that's displayed behind the SVG icon itself. Choosing any option other than none will automatically add a bit of space around the SVG so the background has the necessary space. Note, this option is now available to icons of all sizes!

      • none, circle, square
    • size

      Icon size.

      • small, medium, large, xlarge
    • color

      Icon color palette. Picking an option other than auto will override the default colors based on the color theme is placed within.

      • auto, teal, blue, indigo, yellow, orange, gray, green, white, pink

Make the button to display only the icon and hide the text (which is still required). You are required to pass both text and icon data for this option to work.

boolean false

If present, users will be directed to this URL when clicking this element.


A valid HTML target attribute to modify the behavior when clicking this element. Only valid when "url" is also present.

string _self
  • _blank, _self, _parent, _top, framename

Whether the click action should be disabled for this element.

boolean false

When used with onClickTarget, an event to fire on the targeted elements when this element is clicked. When used without onClickTarget, arbitrary javascript to execute when this element is clicked.


Requires onClick. A CSS selector for elements that the onClick event will fire on when this element is clicked.


Use the align parameter instead.


Use the border_radius parameter instead.


Switch to using the new type prop instead.

string button
  • a, link, button, submit, reset
Debug Panel