You are viewing the deprecated 0.4.4 version of the website. Click here to view the latest version

Documentation

Everything you need to create a website with Bulma

Form controls

All generic form controls, designed for consistency


The following form controls classes are supported:

  • .label
  • .input
  • .textarea
  • .select
  • .checkbox
  • .radio
  • .button
  • .help

Each of them should be wrapped in a .control container.
When combining several controls in a form, use the .field class as a container, to keep the spacing consistent.

This username is available

This email is invalid

<div class="field">
  <label class="label">Name</label>
  <p class="control">
    <input class="input" type="text" placeholder="Text input">
  </p>
</div>

<div class="field">
  <label class="label">Username</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input is-success" type="text" placeholder="Text input" value="bulma">
    <span class="icon is-small is-left">
      <i class="fa fa-user"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
  <p class="help is-success">This username is available</p>
</div>

<div class="field">
  <label class="label">Email</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input is-danger" type="text" placeholder="Email input" value="hello@">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-warning"></i>
    </span>
  </p>
  <p class="help is-danger">This email is invalid</p>
</div>

<div class="field">
  <label class="label">Subject</label>
  <p class="control">
    <span class="select">
      <select>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
  </p>
</div>

<div class="field">
  <label class="label">Message</label>
  <p class="control">
    <textarea class="textarea" placeholder="Textarea"></textarea>
  </p>
</div>

<div class="field">
  <p class="control">
    <label class="checkbox">
      <input type="checkbox">
      I agree to the <a href="#">terms and conditions</a>
    </label>
  </p>
</div>

<div class="field">
  <p class="control">
    <label class="radio">
      <input type="radio" name="question">
      Yes
    </label>
    <label class="radio">
      <input type="radio" name="question">
      No
    </label>
  </p>
</div>

<div class="field is-grouped">
  <p class="control">
    <button class="button is-primary">Submit</button>
  </p>
  <p class="control">
    <button class="button is-link">Cancel</button>
  </p>
</div>

Colors

<div class="field">
  <p class="control">
    <input class="input is-primary" type="text" placeholder="Primary input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-info" type="text" placeholder="Info input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-success" type="text" placeholder="Success input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-warning" type="text" placeholder="Warning input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-danger" type="text" placeholder="Danger input">
  </p>
</div>

Sizes

<div class="field">
  <p class="control">
    <input class="input is-small" type="text" placeholder="Small input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input" type="text" placeholder="Normal input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-medium" type="text" placeholder="Medium input">
  </p>
</div>
<div class="field">
  <p class="control">
    <input class="input is-large" type="text" placeholder="Large input">
  </p>
</div>
<div class="field">
  <p class="control">
    <span class="select is-small">
      <select>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
  </p>
</div>
<div class="field">
  <p class="control">
    <span class="select">
      <select>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
  </p>
</div>
<div class="field">
  <p class="control">
    <span class="select is-medium">
      <select>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
  </p>
</div>
<div class="field">
  <p class="control">
    <span class="select is-large">
      <select>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
  </p>
</div>

States

Normal

<div class="field">
  <p class="control">
    <input class="input" type="text" placeholder="Normal input">
  </p>
</div>
<div class="field">
  <p class="control">
    <textarea class="textarea" placeholder="Normal textarea"></textarea>
  </p>
</div>

Hover

<div class="field">
  <p class="control">
    <input class="input is-hovered" type="text" placeholder="Hovered input">
  </p>
</div>
<div class="field">
  <p class="control">
    <textarea class="textarea is-hovered" placeholder="Hovered textarea"></textarea>
  </p>
</div>

Focus

<div class="field">
  <p class="control">
    <input class="input is-focused" type="text" placeholder="Focused input">
  </p>
</div>
<div class="field">
  <p class="control">
    <textarea class="textarea is-focused" placeholder="Focused textarea"></textarea>
  </p>
</div>

Loading

<div class="field">
  <p class="control is-loading">
    <input class="input" type="text" placeholder="Loading input">
  </p>
</div>
<div class="field">
  <div class="control">
    <div class="select is-loading">
      <select>
        <option>Loading dropdown</option>
      </select>
    </div>
  </div>
</div>
<div class="field">
  <p class="control is-loading">
    <textarea class="textarea" placeholder="Loading textarea"></textarea>
  </p>
</div>

New! 0.4.3

You can resize the loading spinner by appending is-small, is-medium or is-large to the control container.

<div class="field">
  <p class="control is-small is-loading">
    <input class="input is-small" type="text" placeholder="Small loading input">
  </p>
</div>
<div class="field">
  <p class="control is-loading">
    <input class="input" type="text" placeholder="Normal loading input">
  </p>
</div>
<div class="field">
  <p class="control is-medium is-loading">
    <input class="input is-medium" type="text" placeholder="Medium loading input">
  </p>
</div>
<div class="field">
  <p class="control is-large is-loading">
    <input class="input is-large" type="text" placeholder="Large loading input">
  </p>
</div>
<div class="field">
  <div class="control">
    <div class="select is-small is-loading">
      <select>
        <option>Small loading dropdown</option>
      </select>
    </div>
  </div>
</div>
<div class="field">
  <div class="control">
    <div class="select is-loading">
      <select>
        <option>Normal loading dropdown</option>
      </select>
    </div>
  </div>
</div>
<div class="field">
  <div class="control">
    <div class="select is-medium is-loading">
      <select>
        <option>Medium loading dropdown</option>
      </select>
    </div>
  </div>
</div>
<div class="field">
  <div class="control">
    <div class="select is-large is-loading">
      <select>
        <option>Large loading dropdown</option>
      </select>
    </div>
  </div>
</div>

Disabled

<div class="field">
  <p class="control">
    <input class="input" type="text" placeholder="Disabled input" disabled>
  </p>
</div>
<div class="field">
  <div class="control">
    <div class="select is-disabled">
      <select disabled>
        <option>Disabled dropdown</option>
      </select>
    </div>
  </div>
</div>
<div class="field">
  <p class="control">
    <textarea class="textarea" placeholder="Disabled textarea" disabled></textarea>
  </p>
</div>
<div class="field">
  <p class="control">
    <label class="checkbox" disabled>
      <input type="checkbox" disabled>
      Remember me
    </label>
  </p>
</div>
<div class="field">
  <p class="control">
    <label class="radio" disabled>
      <input type="radio" name="question" disabled>
      Yes
    </label>
    <label class="radio" disabled>
      <input type="radio" name="question" disabled>
      No
    </label>
  </p>
</div>
<div class="field is-grouped">
  <p class="control">
    <button class="button is-primary" disabled>Submit</button>
  </p>
  <p class="control">
    <button class="button" disabled>Cancel</button>
  </p>
</div>

With icons

You can append one of 2 modifiers on a control:

  • has-icons-left
  • and/or has-icons-right

You also need to add a modifier on the icon:

  • icon is-left if has-icons-left is used
  • icon is-right if has-icons-right is used

The size of the input will define the size of the icon container.

<div class="field">
  <p class="control has-icons-left">
    <input class="input" type="email" placeholder="Email">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
  </p>
</div>
<div class="field">
  <p class="control has-icons-left">
    <input class="input" type="password" placeholder="Password">
    <span class="icon is-small is-left">
      <i class="fa fa-lock"></i>
    </span>
  </p>
</div>
<div class="field">
  <p class="control">
    <button class="button is-success">
      Login
    </button>
  </p>
</div>

New! 0.4.2

You can now append icons to select dropdowns as well.

<div class="field">
  <p class="control has-icons-left">
    <span class="select">
      <select>
        <option selected>Country</option>
        <option>Select dropdown</option>
        <option>With options</option>
      </select>
    </span>
    <span class="icon is-small is-left">
      <i class="fa fa-globe"></i>
    </span>
  </p>
</div>

If the control contains an icon, Bulma will make sure the icon remains centered, no matter the size of the input or of the icon.

<div class="field">
  <label class="label is-small">Small input</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input is-small" type="email" placeholder="Email">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <label class="label">Normal input</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input" type="email" placeholder="Email">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input" type="email" placeholder="Email">
    <span class="icon is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <label class="label is-medium">Medium input</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input is-medium" type="email" placeholder="Email">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input is-medium" type="email" placeholder="Email">
    <span class="icon is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input is-medium" type="email" placeholder="Email">
    <span class="icon is-medium is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-medium is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <label class="label is-large">Large input</label>
  <p class="control has-icons-left has-icons-right">
    <input class="input is-large" type="email" placeholder="Email">
    <span class="icon is-small is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-small is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input is-large" type="email" placeholder="Email">
    <span class="icon is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input is-large" type="email" placeholder="Email">
    <span class="icon is-medium is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-medium is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

<div class="field">
  <p class="control has-icons-left has-icons-right">
    <input class="input is-large" type="email" placeholder="Email">
    <span class="icon is-large is-left">
      <i class="fa fa-envelope"></i>
    </span>
    <span class="icon is-large is-right">
      <i class="fa fa-check"></i>
    </span>
  </p>
</div>

Form addons

If you want to attach controls together, use the has-addons modifier on the control container:

<div class="field has-addons">
  <p class="control">
    <input class="input" type="text" placeholder="Find a repository">
  </p>
  <p class="control">
    <a class="button is-info">
      Search
    </a>
  </p>
</div>

You can attach inputs, buttons, and dropdowns only.

New! 0.4.2

It can be useful to append a static button.

<div class="field has-addons">
  <p class="control">
    <input class="input" type="text" placeholder="Your email">
  </p>
  <p class="control">
    <a class="button is-static">
      @gmail.com
    </a>
  </p>
</div>

Use the is-expanded modifier on the element you want to fill up the remaining space (in this case, the input):

Transfer

Transfer

<div class="field has-addons">
  <p class="control">
    <span class="select">
      <select>
        <option>$</option>
        <option>£</option>
        <option></option>
      </select>
    </span>
  </p>
  <p class="control">
    <input class="input" type="text" placeholder="Amount of money">
  </p>
  <p class="control">
    <a class="button">
      Transfer
    </a>
  </p>
</div>

<div class="field has-addons">
  <p class="control">
    <span class="select">
      <select>
        <option>$</option>
        <option>£</option>
        <option></option>
      </select>
    </span>
  </p>
  <p class="control is-expanded">
    <input class="input" type="text" placeholder="Amount of money">
  </p>
  <p class="control">
    <a class="button">
      Transfer
    </a>
  </p>
</div>

If you want a full width select dropdown, pair control is-expanded with select is-fullwidth.

<div class="field has-addons">
  <p class="control is-expanded">
    <span class="select is-fullwidth">
      <select name="country">
        <option value="Argentina">Argentina</option>
        <option value="Bolivia">Bolivia</option>
        <option value="Brazil">Brazil</option>
        <option value="Chile">Chile</option>
        <option value="Colombia">Colombia</option>
        <option value="Ecuador">Ecuador</option>
        <option value="Guyana">Guyana</option>
        <option value="Paraguay">Paraguay</option>
        <option value="Peru">Peru</option>
        <option value="Suriname">Suriname</option>
        <option value="Uruguay">Uruguay</option>
        <option value="Venezuela">Venezuela</option>
      </select>
    </span>
  </p>
  <p class="control">
    <button type="submit" class="button is-primary">Choose</button>
  </p>
</div>

Use the has-addons-centered or the has-addons-right modifiers to alter the alignment.

Transfer

<div class="field has-addons has-addons-centered">
  <p class="control">
    <span class="select">
      <select>
        <option>$</option>
        <option>£</option>
        <option></option>
      </select>
    </span>
  </p>
  <p class="control">
    <input class="input" type="text" placeholder="Amount of money">
  </p>
  <p class="control">
    <a class="button is-primary">
      Transfer
    </a>
  </p>
</div>

Transfer

<div class="field has-addons has-addons-right">
  <p class="control">
    <span class="select">
      <select>
        <option>$</option>
        <option>£</option>
        <option></option>
      </select>
    </span>
  </p>
  <p class="control">
    <input class="input" type="text" placeholder="Amount of money">
  </p>
  <p class="control">
    <a class="button is-primary">
      Transfer
    </a>
  </p>
</div>

Form group

If you want to group controls together, use the is-grouped modifier on the control container.
Use the is-grouped-centered or the is-grouped-right modifiers to alter the alignment.

Add the is-expanded modifier on the control element you want to fill up the remaining space.

<div class="field is-grouped">
  <p class="control is-expanded">
    <input class="input" type="text" placeholder="Find a repository">
  </p>
  <p class="control">
    <a class="button is-info">
      Search
    </a>
  </p>
</div>

Horizontal form

If you want a horizontal form control, use the is-horizontal modifier on the field container, in which you include:

  • field-label for the side label
  • field-body for the input/select/textarea container

You can of course use is-grouped or has-addons for the child elements.

This email is correct

This field is required

<div class="field is-horizontal">
  <div class="field-label is-normal">
    <label class="label">From</label>
  </div>
  <div class="field-body">
    <div class="field is-grouped">
      <p class="control is-expanded has-icons-left">
        <input class="input" type="text" placeholder="Name">
        <span class="icon is-small is-left">
          <i class="fa fa-user"></i>
        </span>
      </p>
    </div>
    <div class="field">
      <p class="control is-expanded has-icons-left has-icons-right">
        <input class="input is-success" type="email" placeholder="Email" value="alex@smith.com">
        <span class="icon is-small is-left">
          <i class="fa fa-envelope"></i>
        </span>
        <span class="icon is-small is-right">
          <i class="fa fa-check"></i>
        </span>
      </p>
      <p class="help is-success">This email is correct</p>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-normal">
    <label class="label">Department</label>
  </div>
  <div class="field-body">
    <div class="field is-narrow">
      <div class="control">
        <div class="select is-fullwidth">
          <select>
            <option>Business development</option>
            <option>Marketing</option>
            <option>Sales</option>
          </select>
        </div>
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label">
    <label class="label">Already a member?</label>
  </div>
  <div class="field-body">
    <div class="field is-narrow">
      <div class="control">
        <label class="radio">
          <input type="radio" name="member">
          Yes
        </label>
        <label class="radio">
          <input type="radio" name="member">
          No
        </label>
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-normal">
    <label class="label">Subject</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <input class="input is-danger" type="text" placeholder="e.g. Partnership opportunity">
      </div>
      <p class="help is-danger">
        This field is required
      </p>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-normal">
    <label class="label">Question</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <textarea class="textarea" placeholder="Explain how we can help you"></textarea>
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label">
    <!-- Left empty for spacing -->
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <button class="button is-primary">
          Send message
        </button>
      </div>
    </div>
  </div>
</div>

New!

To preserve the vertical alignment of labels with each type and size of control, the .field-label comes with 4 size modifiers:

  • .is-small
  • .is-normal for any .input or .button
  • .is-medium
  • .is-large
<div class="field is-horizontal">
  <div class="field-label">
    <label class="label">No padding</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <label class="checkbox">
          <input type="checkbox">
          Checkbox
        </label>
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-small">
    <label class="label">Small padding</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <input class="input is-small" type="text" placeholder="Small sized input">
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-normal">
    <label class="label">Normal label</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <input class="input" type="text" placeholder="Normal sized input">
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-medium">
    <label class="label">Medium label</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <input class="input is-medium" type="text" placeholder="Medium sized input">
      </div>
    </div>
  </div>
</div>

<div class="field is-horizontal">
  <div class="field-label is-large">
    <label class="label">Large label</label>
  </div>
  <div class="field-body">
    <div class="field">
      <div class="control">
        <input class="input is-large" type="text" placeholder="Large sized input">
      </div>
    </div>
  </div>
</div>

Bulma Partners

Check out their products!

Bulma Newsletter

Get notified when v1 is ready!