iaBootstrap

Buttons

Default buttons

Button styles can be applied to anything with the .btn class applied. However, typically you'll want to apply these to only <a> and <button> elements for the best rendering.

Button class="" Description
btn Standard gray button with gradient
btn btn-primary Provides extra visual weight and identifies the primary action in a set of buttons
btn btn-info Used as an alternative to the default styles
btn btn-success Indicates a successful or positive action
btn btn-warning Indicates caution should be taken with this action
btn btn-danger Indicates a dangerous or potentially negative action
btn btn-inverse Alternate dark gray button, not tied to a semantic action or use
btn btn-link Deemphasize a button by making it look like a link while maintaining button behavior

Cross browser compatibility

IE9 doesn't crop background gradients on rounded corners, so we remove it. Related, IE9 jankifies disabled button elements, rendering text gray with a nasty text-shadow that we cannot fix.

Button sizes

Fancy larger or smaller buttons? Add .btn-large, .btn-small, or .btn-mini for additional sizes.

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

Create block level buttons—those that span the full width of a parent— by adding .btn-block.

<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>

One class, multiple tags

Use the .btn class on an <a>, <button>, or <input> element.

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">

As a best practice, try to match the element for your context to ensure matching cross-browser rendering. If you have an input, use an <input type="submit"> for your button.



Button groups

Two basic options, along with two more specific variations.

Single button group

Wrap a series of buttons with .btn in .btn-group.

<div class="btn-group">
  <button class="btn">Left</button>
  <button class="btn">Middle</button>
  <button class="btn">Right</button>
</div>

Multiple button groups

Combine sets of <div class="btn-group"> into a <div class="btn-toolbar"> for more complex components.

<div class="btn-toolbar">
  <div class="btn-group">
    ...
  </div>
</div>

Newsline

Hands on: Pixelmator for iPad is a valuable tool for artists and photographers

Hands on: Pixelmator for iPad is a valuable tool for artists and photographers

Oct 25, 2014

Now that it’s here — just in time for iOS 8 — we took Pixelmator for iPad for a spin and found it a solid contribution to the slate of image editors for the iPad, and especially useful for those already using Pixelmator on the desktop. With the mobile Pixelmator, available... continue reading

Hipstamatic’s TinType photo effects app harks back to the 1800s

Hipstamatic’s TinType photo effects app harks back to the 1800s

Oct 25, 2014

Sometimes the simplest apps are the most visually powerful, and that’s the case with  TinType , an iPhone app that you imparts a luminous, hand-tinted vintage look to your images. TinType takes about five minutes to learn — if you haven’t had your coffee yet. Launch... continue reading

How the design team behind ‘Destiny’ built their immersive worlds

How the design team behind ‘Destiny’ built their immersive worlds

Oct 25, 2014

If you’re even remotely into video games, you’ve heard of  Destiny . It’s the mega-blockbuster game of the season that’s become a multi-record breaker since its release in September. And now it holds the distinction of being the best-selling new franchise of all... continue reading