button docs

button

This is a button

button size variations

Note: medium is the default size.

This is a xsmall button

This is a small button

This is a medium button

This is a large button

This is a xlarge button

button style variations

Primary button Primary button (disabled) Secondary button Secondary button (disabled) Tertiary button Tertiary button (disabled) Text button Text button (disabled)

button theme variations

Buttons inside a xdark theme

Primary button Secondary button Tertiary button Text button

Buttons inside a dark theme

Primary button Secondary button Tertiary button Text button

Buttons inside a light theme

Primary button Secondary button Tertiary button Text button

Buttons inside a xlight theme

Primary button Secondary button Tertiary button Text button

button width variations

Note: full@small means that the button will go from auto width to full width when the browser goes below the small breakpoint.

This is a auto width button

This is a full width button

This is a full@small width button

This button has regular border radius

This button has full border radius

button align variations

Note: the align prop only works with full width buttons.

This button's items are aligned to the start

This button's items are aligned to the center

This button's items are aligned to the end

button transform variations

This button has text tranform of uppercase

This button has text tranform of lowercase

This button has text tranform of capitalize

This button has text tranform of none

button type variations

This button's type is: button

This button's type is: submit

This button's type is: reset

button with text and icon

Note: when passing icons inside a button, it is required to define the icon's position, by default it is set to after, which means the icon will come after the text.

Icon position set to before

This button has text and icon

Icon position set to after

This button has text and icon

button icon only

Note: an icon-only button still is still required to have text, and that text is accessible through screen readers. It's just visually hidden.

This button's text is still accessible, it's just visually hidden. Xsmall icon-only button

This button's text is still accessible, it's just visually hidden. Small icon-only button

This button's text is still accessible, it's just visually hidden. Medium icon-only button

This button's text is still accessible, it's just visually hidden. Large icon-only button

This button's text is still accessible, it's just visually hidden. Xlarge icon-only button

Full border radius (circle icon-only button)

This button's text is still accessible, it's just visually hidden.

Examples with different icons

This button's text is still accessible, it's just visually hidden. This button's text is still accessible, it's just visually hidden. This button's text is still accessible, it's just visually hidden. This button's text is still accessible, it's just visually hidden. This button's text is still accessible, it's just visually hidden. This button's text is still accessible, it's just visually hidden.

button with 3rd party js

Add a js- target class for the button to perform something through javascript

Toggle theme with javascript

button with web component

Web Component Usage Bolt Button is a web component, you can simply use <bolt-button> in the markup to make it render.
This is a button
<bolt-button url="https://pega.com"> This is a button </bolt-button>
Basic Usage To use icon in combination with text within the button, you must pass <bolt-icon> with a slot attribute defined as either before or after. Note: the slot attribute is required in order for the icon to be placed and spaced correctly within the button. Even if icon-only option is turned on, slot is still required.

This is a button

This is a button

This is a button

<p> <bolt-button> <bolt-icon name="chevron-left" slot="before"></bolt-icon> This is a button </bolt-button> </p> <p> <bolt-button> <bolt-icon name="chevron-right" slot="after"></bolt-icon> This is a button </bolt-button> </p> <p> <bolt-button icon-only> <bolt-icon name="close" slot="before"></bolt-icon> This is a button </bolt-button> </p>
Advanced Usage The web component has all the options shown in the schema table. You can define each prop within the <bolt-button> element. Use unique combinations to customize a button to your liking. Note: the style prop is named color instead.
This is a button
<bolt-button url="https://pega.com" size="large" color="secondary" border-radius="full" tag="a" icon-only > <bolt-icon name="menu" slot="before"></bolt-icon> This is a button </bolt-button>
Server-side Rendered Web Components (Experimental) The <bolt-button> component, among many other web components in Bolt, will support server-side rendering via the new upcoming {% filter bolt_ssr %} custom Twig filter. Check out the docs on server-side rendering for information!
<bolt-button> This is a button <bolt-icon name="chevron-right" slot="after"></bolt-icon> </bolt-button>