Skip to main content

Components

Buttons

Bootstrap's button styles with the bracket radius, three extra brand colours, and toggle states driven by .btn-check instead of a plugin.

How it works

Button classes are unchanged from Bootstrap. What changes is the look — a 2 px "bracket" radius, weight 500, gold primary — and the toggle behaviour. Bootstrap's button plugin (data-bs-toggle="button") is gone. Toggle state comes from a hidden checkbox or radio with .btn-check, which Bootstrap already styles in CSS.

  • Baseline: .btn-check + <label class="btn">. Works everywhere.
  • Enhancement: none needed.
  • Fallback: the static .active class still renders the pressed look.

Base class

.btn alone gives padding, alignment and the focus ring, with transparent background and border. Combine it with a variant.

HTML
<button type="button" class="btn">Base class</button>

Variants

The eight Bootstrap variants plus .btn-gold, .btn-navy and .btn-cream. Primary is gold-700 in light mode and gold-500 in dark mode; both carry navy text.

HTML
<button type="button" class="btn btn-primary">Primary</button>
<button type="button" class="btn btn-secondary">Secondary</button>
<button type="button" class="btn btn-success">Success</button>
<button type="button" class="btn btn-danger">Danger</button>
<button type="button" class="btn btn-warning">Warning</button>
<button type="button" class="btn btn-info">Info</button>
<button type="button" class="btn btn-light">Light</button>
<button type="button" class="btn btn-dark">Dark</button>
<button type="button" class="btn btn-gold">Gold</button>
<button type="button" class="btn btn-navy">Navy</button>
<button type="button" class="btn btn-cream">Cream</button>
<button type="button" class="btn btn-link">Link</button>
.btn-gold is always gold-500; .btn-primary follows the colour mode. Use .btn-gold when the button must look the same on a dark hero as on a cream page.

Disable text wrapping

Add .text-nowrap to stop the label from wrapping. Or set $btn-white-space: nowrap in Sass.

HTML
<button type="button" class="btn btn-primary text-nowrap" style="width: 8rem;">Do not wrap this</button>

Button tags

The classes are made for <button> but work on <a> and <input>. Add role="button" to links used as actions. A <summary class="btn"> is also a button in this theme — that is how collapse and dropdown triggers are built.

Link
HTML
<a class="btn btn-primary" href="#!" role="button">Link</a>
<button class="btn btn-primary" type="submit">Button</button>
<input class="btn btn-primary" type="button" value="Input">
<input class="btn btn-primary" type="submit" value="Submit">
<input class="btn btn-primary" type="reset" value="Reset">

Outline buttons

Replace the modifier with .btn-outline-* for a transparent fill that inverts on hover.

HTML
<button type="button" class="btn btn-outline-primary">Primary</button>
<button type="button" class="btn btn-outline-secondary">Secondary</button>
<button type="button" class="btn btn-outline-success">Success</button>
<button type="button" class="btn btn-outline-danger">Danger</button>
<button type="button" class="btn btn-outline-warning">Warning</button>
<button type="button" class="btn btn-outline-info">Info</button>
<button type="button" class="btn btn-outline-light">Light</button>
<button type="button" class="btn btn-outline-dark">Dark</button>
<button type="button" class="btn btn-outline-gold">Gold</button>
<button type="button" class="btn btn-outline-navy">Navy</button>
<button type="button" class="btn btn-outline-cream">Cream</button>
Outline buttons have no fill, so their contrast against the page is the border and text only. .btn-outline-light and .btn-outline-cream are for dark backgrounds.

Sizes

.btn-lg and .btn-sm. The radius stays 2 px at every size.

HTML
<button type="button" class="btn btn-primary btn-lg">Large button</button>
<button type="button" class="btn btn-secondary btn-lg">Large button</button>
HTML
<button type="button" class="btn btn-primary btn-sm">Small button</button>
<button type="button" class="btn btn-secondary btn-sm">Small button</button>

Or set the CSS variables inline for a custom size.

HTML
<button type="button" class="btn btn-primary" style="--bs-btn-padding-y: .25rem; --bs-btn-padding-x: .5rem; --bs-btn-font-size: .75rem;">Custom button</button>

Disabled state

Use the disabled attribute on buttons. The theme fades them to 65 % opacity.

HTML
<button type="button" class="btn btn-primary" disabled>Primary button</button>
<button type="button" class="btn btn-secondary" disabled>Button</button>
<button type="button" class="btn btn-outline-primary" disabled>Primary button</button>
<button type="button" class="btn btn-outline-secondary" disabled>Button</button>

Links have no disabled attribute. Add .disabled, aria-disabled="true" and tabindex="-1"; the class also sets pointer-events: none.

HTML
<a class="btn btn-primary disabled" role="button" aria-disabled="true" tabindex="-1">Primary link</a>
<a class="btn btn-secondary disabled" role="button" aria-disabled="true" tabindex="-1">Link</a>

Block buttons

Stack full-width buttons with .d-grid and .gap-*. The gap scale is 4 px based: .gap-2 is 0.5 rem.

HTML
<div class="d-grid gap-2">
  <button class="btn btn-primary" type="button">Button</button>
  <button class="btn btn-primary" type="button">Button</button>
</div>

Responsive: full width on small screens, inline from md up.

HTML
<div class="d-grid gap-2 d-md-block">
  <button class="btn btn-primary" type="button">Button</button>
  <button class="btn btn-primary" type="button">Button</button>
</div>

Right-aligned with equal widths using .col-* and .mx-auto:

HTML
<div class="d-grid gap-2 d-md-flex justify-content-md-end">
  <button class="btn btn-primary me-md-2" type="button">Button</button>
  <button class="btn btn-primary" type="button">Button</button>
</div>

.btn-link looks like a text link but keeps button padding and alignment. It uses --bs-link-color (navy-700) and turns gold on hover.

HTML
<button type="button" class="btn btn-link">Link button</button>
<button type="button" class="btn btn-link" disabled>Disabled link button</button>

Toggle states

In stock Bootstrap, data-bs-toggle="button" flips .active with JavaScript. That attribute is inert here. Use a hidden <input class="btn-check"> followed by a <label class="btn">; the label renders the pressed state while the input is checked. The id / for pair is what links them.

HTML
<input type="checkbox" class="btn-check" id="buttons-check-1" autocomplete="off">
<label class="btn btn-primary" for="buttons-check-1">Single toggle</label>
HTML
<input type="checkbox" class="btn-check" id="buttons-check-2" checked autocomplete="off">
<label class="btn btn-primary" for="buttons-check-2">Checked</label>

Outline variants fill in when checked. In dark mode the checked primary fill is gold-500.

HTML
<input type="checkbox" class="btn-check" id="buttons-check-outlined" autocomplete="off">
<label class="btn btn-outline-primary" for="buttons-check-outlined">Single toggle</label>

<input type="checkbox" class="btn-check" id="buttons-check-outlined-2" checked autocomplete="off">
<label class="btn btn-outline-secondary" for="buttons-check-outlined-2">Checked</label>

Radios give you a one-of-many toggle. Share a name.

HTML
<input type="radio" class="btn-check" name="buttons-radio" id="buttons-radio-1" autocomplete="off" checked>
<label class="btn btn-secondary" for="buttons-radio-1">Checked</label>

<input type="radio" class="btn-check" name="buttons-radio" id="buttons-radio-2" autocomplete="off">
<label class="btn btn-secondary" for="buttons-radio-2">Radio</label>

<input type="radio" class="btn-check" name="buttons-radio" id="buttons-radio-3" autocomplete="off">
<label class="btn btn-secondary" for="buttons-radio-3">Radio</label>

Disabled inputs disable the label.

HTML
<input type="checkbox" class="btn-check" id="buttons-check-disabled" disabled autocomplete="off">
<label class="btn btn-primary" for="buttons-check-disabled">Disabled</label>
<input type="checkbox" class="btn-check" id="buttons-check-disabled-2" disabled checked autocomplete="off">
<label class="btn btn-outline-primary" for="buttons-check-disabled-2">Disabled checked</label>
The static .active class (and aria-pressed="true") still renders the pressed look for server-rendered state. It just does not toggle on click. For grouped toggles see Button group.
HTML
<button type="button" class="btn btn-primary active" aria-pressed="true">Active toggle button</button>
<button type="button" class="btn btn-primary active" aria-pressed="true" disabled>Active toggle button</button>

Accessibility

  • Use <button> for actions and <a> for navigation. A link styled as a button still needs role="button".
  • .btn-check hides the input off-screen but keeps it focusable; the label shows the focus ring via :focus-visible.
  • The focus ring is rgba(gold, .4) in light mode; it stays visible on cream and navy backgrounds.
  • Never rely on colour alone to tell variants apart; the gold primary and the warning yellow are close in hue.

CSS

All of Bootstrap's --bs-btn-* variables apply.

.btn {
  --bs-btn-padding-x: 0.75rem;
  --bs-btn-padding-y: 0.375rem;
  --bs-btn-font-size: 1rem;
  --bs-btn-font-weight: 500;          // $btn-font-weight
  --bs-btn-border-radius: 2px;        // $btn-border-radius: $border-radius-sm (all sizes)
  --bs-btn-disabled-opacity: 0.65;
}

Sass variables that differ from stock Bootstrap, from scss/_variables.scss:

$btn-border-radius: $border-radius-sm;     // 2px
$btn-border-radius-sm: $border-radius-sm;
$btn-border-radius-lg: $border-radius-sm;
$btn-font-weight: 500;

The dark-mode swap for .btn-primary and .btn-outline-primary lives in scss/_tokens.scss; it re-runs button-variant() with gold-500 under both [data-bs-theme="dark"] and prefers-color-scheme: dark.