Buttons
Custom button styles for actions in forms, dialogs, and more with support for multiple sizes, states, and more.
Sizes
Fancy larger or smaller buttons? Add size="lg" or size="sm" for additional sizes.
Here we create a responsive variation, starting with vertically stacked buttons until the md breakpoint, where .d-md-block replaces the .d-grid class, thus nullifying the gap-2 utility. Resize your browser to see that change.
You can adjust the width of your block buttons with grid column width classes. For example, for a half-width “block button”, use md={6}. Center it horizontally with .mx-auto, too.
Additional utilities can be used to adjust the alignment of buttons when horizontal. Here we’ve taken our previous responsive example and added some flex utilities and a margin utility on the button to right align the buttons when they’re no longer stacked.
Active state
To set a button's active state simply set the component's active prop.
Disabled state
Make buttons look inactive by adding the disabled prop to.
Toggle states
Buttons can also be used to style checkbox and radio form elements. This is helpful when you want a toggle button that works neatly inside an HTML form.
