Skip to content
Related Articles

Related Articles

Improve Article

Bulma | Input

  • Last Updated : 15 Jul, 2020

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.




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

Output:



Example 2: This example illustrates coloured form input.




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

Output:

Example 3: This example illustrates different size form input.




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

Output:

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




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

Output:

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




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

Output:

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




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

Output :




My Personal Notes arrow_drop_up
Recommended Articles
Page :