Tutorialsplane

Bulma Form


Bulma Form – Bulma Css provides form controls to create beautiful form. Here in this article we are going to explain how to create form controls. You can use our online editor to edit and run the code online.


Bulma Form Example

Following topics are covered in this tutorial-

  1. Input
  2. Textarea
  3. Select
  4. Checkbox
  5. Radio
  6. File

Input

To create a simple input box add class input to input box.

Bulma Form Example:


Try it »

If you run the above example it will produce output like this –

Input Color

We can use color modifiers to change the input color for example – is-primary, is-info.

Bulma Change Input Color Example:

 <div class="control">
 
  </div>

<div class="field">
  <div class="control">
 
  </div>
</div>
<div class="field">
  <div class="control">
 
  </div>
</div>
<div class="field">
  <div class="control">
 
  </div>
</div>
<div class="field">
  <div class="control">
 
  </div>
</div>

Try it »

If you run the above example it will produce output something like this-

Input Size

Following sizes are available for input box-

Form Sizes Example:

<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>

Try it »

Input States

Following states are available-

Bulma Input States Example:

<div class="field">
 <div class="control">
  
 </div>
<div class="field">
 <div class="control">
  
</div>
</div>
<div class="field">
 <div class="control">
  
 </div>
</div>
<div class="field">
  <div class="control is-loading">
  
  </div>
</div>

</div>

Try it »

The output of above example will be –

Textarea

class=”textarea” is used to create textarea in Bulma.

Bulma Textarea Example:


Try it »

Textarea Colors

You can change the textarea color using the modifier classes.

Textarea Colors Example:

<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>
<div class="field">
  <div class="control">
    
  </div>
</div>

Try it »

If you run the above example it will produce output something like this-

Textarea Sizes

You can change the size of textarea by adding the modifier classes. Following sizes are available-

Textarea State

You can add following states in textarea by adding modifer classes-

Disabled Textarea

If you want to create disabled textarea add attribute – disabled. Here is an example of disabled textarea.

 

Select Dropdowm

Wrap form select element by class=”select” it will add the style to default select box.

Bulma Select Box Example:

<div class="select">
  
</div>

Try it »

Out of above example-

Multi Select Dropdown

By adding the modifier class is-multiple, you can change the style of default muli select dropdown.

Bulma Multi Select Drop down Example:

 <div class="select is-multiple">
  
  </div>

Select Dropdown Colors

You can use modifiers classes to change the dorpdown colors. In the below example we have used color modifier class – is-primary to change the dropdown menu color.

 <div class="select is-primary">
  
  </div>

Add Icon to Select Dropdown

You can add icon to select dropdown menu. Here is an example of icon-

<div class="field">
  <div class="control has-icons-left">
    <div class="select">
      
    </div>
    <div class="icon is-small is-left">
      <i class="fa fa-globe"></i>
    </div>
  </div>
</div>

The output of above example will look something like this-

Checkbox

To style checkbox wrap the default checkbox by label class=”checkbox”.


Radio Button

You can create radio button simply as below-

<div class="control">
  
  
</div>

Bulma Tutorial