Bootstrap Buttons

Use the .btn class to apply button styling. This reference shows the available button variations, sizing classes, full-width buttons, disabled states, and supported HTML elements used in this style guide.

Button classes at a glance

Apply .btn to an <a>, <button>, or <input> element. In most cases, use links for navigation and buttons for actions.

Example Class Purpose
btn Standard gray button with a gradient.
btn btn-primary Highlights the primary action in a group of buttons.
btn btn-info An alternative to the default style.
btn btn-success Indicates a positive or successful action.
btn btn-warning Signals that caution is appropriate.
btn btn-danger Indicates a potentially negative or destructive action.
btn btn-inverse An alternate dark gray button that is not tied to a semantic action.
btn btn-link Looks like a link while retaining button behavior.

Button sizes and full-width buttons

Add a size class to make a button larger or smaller:

  • .btn-large for large buttons
  • No size modifier for the default size
  • .btn-small for small buttons
  • .btn-mini for mini buttons

Size examples

<button class="btn btn-large btn-primary" type="button">Large button</button>
<button class="btn btn-primary" type="button">Default button</button>
<button class="btn btn-small btn-primary" type="button">Small button</button>
<button class="btn btn-mini btn-primary" type="button">Mini button</button>

Block-level buttons

Add .btn-block to create a button that spans the full width of its parent.

<button class="btn btn-large btn-block btn-primary" type="button">Block level button</button>
<button class="btn btn-large btn-block" type="button">Block level button</button>

Disabled buttons

Disabled buttons are visually faded. The implementation differs depending on whether you are using a link or a button element.

Disabled links

Add the .disabled class to an <a> button.

Primary link Link

<a href="#" class="btn btn-large btn-primary disabled">Primary link</a>
<a href="#" class="btn btn-large disabled">Link</a>

Note: .disabled is a visual utility class for links. Custom JavaScript is required to prevent a disabled link from functioning.

Disabled button elements

Add the disabled attribute to a <button> element.

<button class="btn btn-large btn-primary disabled" type="button" disabled="disabled">Primary button</button>
<button class="btn btn-large" type="button" disabled>Button</button>

Use button classes with links, buttons, and inputs

The .btn class can be used on anchor, button, and input elements.

Link

<a class="btn" href="#">Link</a>
<button class="btn" type="submit">Button</button>
<input class="btn" type="button" value="Input">
<input class="btn" type="submit" value="Submit">

For more consistent rendering, match the element to its purpose. For example, use <input type="submit"> when an input is submitting a form.

Bootstrap button FAQ

Which class creates a standard Bootstrap button?

Use .btn for the standard button style.

How do I create a primary button?

Use .btn.btn-primary to give a button additional visual weight and identify the primary action.

How do I make a button full width?

Add .btn-block to a button. Combine it with size and style classes as needed, such as .btn.btn-large.btn-block.btn-primary.

Does the disabled class stop a link from working?

No. On links, .disabled is visual only. Custom JavaScript is needed to prevent the link action.

How do I disable a button element?

Add the disabled attribute to the <button> element.

Back to Top
Product has been added to your cart
Compare (0)