Bulma | Input

Bulma is a free, open-source CSS framework based on Flexbox. It is component rich, compatible, and well documented. It is highly responsive in nature. It uses classes to implement its design.

The ‘input’ component of a form is not that attractive in look. Using Bulma we can design input elements of the form in a far better way just by adding some simple Bulma classes. Bulma input elements are available in different colors, different styles, different sizes, and different states.

Example 1: This Example illustrates simple Bulma input.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns
     {
        margin-top: 80px;
      }
    </style>
  </head>
  <body>   
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control">
              <input class="input" 
                     type="text" 
                     placeholder='Normal Input'>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output:



Example 2: This example illustrates coloured form input.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns{
        margin-top: 80px;
      }
    </style>
  </head>
  <body>   
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control">
              <input class="input is-primary" 
                     type="text" 
                     placeholder='Primary color Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-link" 
                     type="text" 
                     placeholder='Link color Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-info" 
                     type="text" 
                     placeholder='Info color Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-success" 
                     type="text" 
                     placeholder='success color Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-warning" 
                     type="text" 
                     placeholder='Warning color Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-danger" 
                     type="text" 
                     placeholder='Danger color Input'>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output:

Example 3: This example illustrates different size form input.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns{
        margin-top: 80px;
      }
    </style>
  </head>
  <body>   
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control">
              <input class="input is-small" 
                     type="text"
                     placeholder='Small input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input"
                     type="text"
                     placeholder='Normal Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-medium" 
                     type="text"
                     placeholder='Medium Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-large"
                     type="text"
                     placeholder='Large Input'>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output:

Example 4: This example illustrates different states of form input.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns{
        margin-top: 80px;
      }
    </style>
  </head>
  <body>   
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control">
              <input class="input" type="text" 
                     placeholder='Normal Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-hovered"
                     type="text" 
                     placeholder='Hovered Input'>
            </div>
          </div>
          <div class="field">
            <div class="control">
              <input class="input is-focused" 
                     type="text" 
                     placeholder='Focused Input'>
            </div>
          </div>
          <div class="field">
            <div class="control is-loading">
              <input class="input" type="text" 
                     placeholder="Loading input">
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output:

Example 5: This example illustrates form input with font awesome icons.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns{
        margin-top: 80px;
      }
    </style>
  </head>
  <body>
  
    <!-- font-awesome cdn -->
    <script src=
    </script>
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control has-icons-left">
              <input class="input"
                     type="text"
                     placeholder="Username">
              <span class="icon is-small is-left">
                <i class="fas fa-user"></i>
              </span>
            </div>
          </div>
          <div class="field">
            <div class="control has-icons-left">
              <input class="input" 
                     type="password"
                     placeholder="Password">
              <span class="icon is-small is-left">
                <i class="fas fa-lock"></i>
              </span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output:

Example 6: This example illustrates rounded type of form inputs.

filter_none

edit
close

play_arrow

link
brightness_4
code

<!DOCTYPE html>
<html>
  <head>
    <title>Bulma Input</title>
    <link rel='stylesheet' href=
  
    <!-- custom css -->
    <style>
      div.columns{
        margin-top: 80px;
      }
    </style>
  </head>
  <body>
  
    <!-- font-awesome cdn -->
    <script src=
    </script>
    <div class='container'>
      <div class='columns is-mobile is-centered'>
        <div class='column is-5'>
          <div class="field">
            <div class="control has-icons-left">
              <input class="input is-rounded" 
                     type="text" 
                     placeholder="Username">
              <span class="icon is-small is-left">
                <i class="fas fa-user"></i>
              </span>
            </div>
          </div>
          <div class="field">
            <div class="control has-icons-left">
              <input class="input is-rounded" 
                     type="password" 
                     placeholder="Password">
              <span class="icon is-small is-left">
                <i class="fas fa-lock"></i>
              </span>
            </div>
          </div>
        </div>
      </div>
    </div>
  </body>
</html>

chevron_right


Output :




My Personal Notes arrow_drop_up

Check out this Author's contributed articles.

If you like GeeksforGeeks and would like to contribute, you can also write an article using contribute.geeksforgeeks.org or mail your article to contribute@geeksforgeeks.org. See your article appearing on the GeeksforGeeks main page and help other Geeks.

Please Improve this article if you find anything incorrect by clicking on the "Improve Article" button below.


Article Tags :

Be the First to upvote.


Please write to us at contribute@geeksforgeeks.org to report any issue with the above content.