Basic button
Also see the <Button> React component
The .bf-button will apply bifrost button styling:
Link styled as button
The .bf-button class, and all the combinations below can also be applied to
<a> elements.
Filled and flat variants
Another two alternative button variants are supplied:
.bf-button-filledfor primary call-to-action buttons.bf-button-flatfor tertiary rarely-needed actions
State colors
Another three alternative button variants are supplied:
.bf-button-alertfor destructive actions.bf-button-inactivefor currently unavailable actions (should still happen something on click, like a tooltip explaining why the button is inactive).bf-button-invertedfor use on contrasting backgrounds
Combine variants and states
| state | variant | ||
|---|---|---|---|
| default | |||
| inactive | |||
| neutral | |||
| alert | |||
| inverted | |||
Rounded corners (pill button)
Small size
Button group
Split button
.bf-button-split joins two .bf-button elements into one control: a primary
action and a trigger for a menu of related actions. It only handles the visual
join, so apply the same variant, state and size classes to both buttons. The
trigger has no visible text, so give it an aria-label.
Filled buttons have no border, so a 1px gap separates the two halves.
.bf-button-split does not open a menu by itself. Use a
dropdown anchored to the trigger, and set aria-expanded on
the trigger to reflect whether the menu is open.
Expand button
Control open state by toggling the .bf-expand-icon-open class on the icon.
A note about type
The default type of a <button> is
submit.
Unless you need the button to submit a <form> you probably want
<button type='button'> instead.
<form>
<button>this button will submit the form</button>
<button type="button">this will not (use js to handle clicks)</button>
</form>