The button is an essential element of any design. It's meant to look and behave as an interactive element of your page.
Button
The classic button, in different colors, sizes, and states
Example
HTML
The button
class can be used on:
<a>
anchor links<button>
form buttons<input type="submit">
submit inputs<input type="reset">
reset inputs
Example
HTML
Colors #
The button is available in all the different colors defined by the
$colors
Sass map.
Example
HTML
Example
HTML
Each color also comes in its light version. Simply append the modifier is-light
to the
color modifier to apply the light version of the button.
Example
HTML
A dark version also exists. Simply append the modifier is-dark
.
Example
HTML
Sizes #
The button comes in 4 different sizes:
- small
- normal
- medium
- large
While the default size is the normal one, the is-normal
modifier exists in case you
need to reset the button to its normal size.
Example
HTML
You can change the size of multiple buttons at once by wrapping them in a
buttons
parent, and applying one of 3 modifiers:
-
buttons are-small
-
buttons are-medium
-
buttons are-large
Example
HTML
You can change the size of only a subset of buttons by simply applying a modifier class to them.
For example, if you want all buttons to be small but still have one in its
normal size, simply do the following:
Example
HTML
Responsive sizes #
If you want different button sizes for each breakpoint, you can use Bulma's
responsive buttons. Simply append the is-responsive
modifier:
Name | Fixed size | Responsive size (resize window to see in action) | Code |
---|---|---|---|
Default | |||
Small | |||
Normal | |||
Medium | |||
Large |
You can customise the sizes by overwriting the
$button-responsive-sizes
Sass variable.
Displays #
Example
HTML
Styles #
Outlined
Example
HTML
Inverted (the text color becomes the background color, and vice-versa)
Rounded buttons
States #
Bulma styles the different states of its buttons. Each state is available as a pseudo-class and a CSS class:
:hover
andis-hovered
:focus
andis-focused
:active
andis-active
This allows you to obtain the style of a certain state without having to trigger it.
Normal
Example
HTML
Hover
Example
HTML
Focus
Example
HTML
Active
Example
HTML
Loading
You can very easily turn a button into its loading version by appending the
is-loading
modifier. You don't even need to remove the inner text, which allows the button to maintain
its original size between its default and loading states.
Static
You can create a non-interactive button by using the is-static
modifier. This is
useful to align a text label with an input, for example when using
form addons.
Disabled
Bulma supports the use of the disabled
Boolean HTML attribute, which prevents the user from interacting with the button.
With Font Awesome icons
Bulma buttons can easily be enhanced by adding a
Font Awesome icon. For the best results, wrap the inner text in a separate
<span>
element.
Example
HTML
If the button only contains an icon, Bulma will make sure the button remains square, no matter the size of the button or of the icon.
Button group #
If you want to group buttons together on a single line, use the
is-grouped
modifier on the field
container:
Example
HTML
Button addons #
If you want to use buttons as addons, use the has-addons
modifier on the
field
container:
Example
HTML
Button group with addons #
You can group together addons as well:
Example
HTML
List of buttons #
You can create a list of buttons by using the buttons
container.
If the list is very long, it will automatically wrap on multiple lines, while keeping all buttons evenly spaced.
You can attach buttons together with the has-addons
modifier.
Use the is-centered
or the is-right
modifiers to alter the alignment.
You can use any modifier class on each button to differentiate them. Make sure to add the
is-selected
modifier as well to make sure the selected button is above its siblings.
Sass and CSS variables #
Sass Variable
|
CSS Variable
|
Value
|
---|---|---|