Buttons




Button

Button Variants


The primary button is used for the most important button on the page. Secondary buttons can be used for actions that are less important. Button links can be helpful for buttons that do not need a lot of attention drawn to them. Disabled buttons are used when you don't want the user to click the button. Danger buttons are used to indicate destructive actions such as deleting.

Reaction Button


The reaction variant accepts any HTML Emoji or it's hexa/decimal ref (see here) as a string within the icon prop. If nothing is passed to the icon prop, the default reaction button will be displayed as seen in the third example. The default reaction button will also be rendered if a Fontawesome icon (not an Emoji) is passed to the icon prop of a reaction variant, but the default "smiley +" icon will be replaced with the named icon.

Reaction buttons also accept two additional (optional) props: count, which accepts a number (i.e., a count of reactions) to be displayed next to the Emoji; and highlight, which is a boolean that if true, displays the 'active' state for the button. Click the first reaction button to see this in action!

Button Full Width


This button is used many times for mobile or other things like cards and sidebars.

Button Loading


Used when a button will take a little while to load. The spinner lets the user know that the button has worked and it is in the process of loading.

Button Block Content


Used when the user wants to display custom content within a button instead of passing in text or props to the kit itself. In this example the button is using the Pill kit and a <span> element inside the button.

Button Icon Options


Icons can also be added to a button if needed. By default, the icon will be displayed on the left of the text. To display the icon on the right, use the optional prop of iconRight in react or icon_right in rails.

Button Accessibility Options

Button with ARIA
Button Additional Options


Button Size


By default button has the md size style, even if you don't explicitly pass a size prop.

Button Form Attribute


Button Toolbar

Default


Secondary


Circle Icon Button

Default





Loading





Size


The size prop accepts "sm" as a value to make the Circle Icon Button 20px x 20px instead of the default 40px x 40px size.

Icon Button

Default


Sizes

Large
Small
XSmall
1x
2x
3x
4x

Copy Button

Default


Copy From

Copy this body text!

Provide an element's ID as the from parameter, and its text will be copied. If the element is an input, its value will be copied; otherwise, the innerText will be used. Additionally, if a value prop is provided, it will override the content from the from element and be copied instead.

Copy Hook

I'm a custom copy hook! Click this body to copy this text!

You can use any external control (like the text itself or an icon) to copy. To use this hook, set the data-external-copy-from attribute on the external control to the copying ID. This will grab the innerText from your_id element, or value if it is an input element. Alternatively, you can set a data-external-copy-value attribute and copy custom text.

See the code example for details.