Bolt Button

A Pega branded call to action.

Published Last updated: 3.6.0 Change log Github NPM
Twig Usage
  {% include "@bolt-components-button/button.twig" with {
  text: "This is a button"
} only %}
Schema
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)
attributes

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

object
text *

Text inside the button.

string
transform

Transforms the button text to various cases.

string none
  • uppercase , lowercase , capitalize , none
type

Determines the button tag type for semantic buttons

string
  • button , submit , reset
size

Size of the button.

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

Style of the button determined by information hierarchy.

string primary
  • primary , secondary , tertiary , text
width

Controls the width of the button.

string auto
  • auto , full , full@small
border_radius

Rounds the corners of the button.

string regular
  • regular or full
align

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

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

object
    • 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

      Controls the size of the icon. Each size is set to a specific pixel value: 16px, 24px, 32px, and 38px. However, this prop is optional. When no size is specified, the icon is expected to act as an inline icon, which will grow or shrink depending on the font-size of its parent container.

      • 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 , navy , yellow , orange , gray , pink , berry , wine , violet
iconOnly

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
url

Optional. Contains a URL that the chip points to. When URL is present, tag changes to a, otherwise tag would be span.

string
target

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
disabled

Make trigger unusable and un-clickable. Only applies to button.

boolean false
on_click

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

string
on_click_target

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

string
onClick
(deprecated)

Use on_click instead.

onClickTarget
(deprecated)

Use on_click_target instead.

itemAlignment
(deprecated)

Use the align parameter instead.

rounded
(deprecated)

Use the border_radius parameter instead.

tag
(deprecated)

Switch to using the new type prop instead.

string button
  • a , link , button , submit , reset
style
(deprecated)

Switch to using the new hierarchy prop instead.

string primary
  • primary , secondary , tertiary , text
Install Install
  npm install @bolt/components-button
Dependencies @bolt/components-icon @bolt/core-v3.x @bolt/element @bolt/lazy-queue