Bulma | Input - GeeksforGeeks

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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- 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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- custom css -->    <style>      div.columns{        margin-top: 80px;      }    </style>  </head>  <body>      <!-- font-awesome cdn -->    <script src='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>    </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='https://cdnjs.cloudflare.com/ajax/libs/bulma/0.7.5/css/bulma.css'>      <!-- custom css -->    <style>      div.columns{        margin-top: 80px;      }    </style>  </head>  <body>      <!-- font-awesome cdn -->    <script src='https://cdnjs.cloudflare.com/ajax/libs/font-awesome/5.12.0-2/js/all.min.js'>    </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 :
Bulma
CSS
Web Technologies
Writing code in comment?
Please use ide.geeksforgeeks.org,
generate link and share the link here.
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?
How to create footer to stay at the bottom of a Web page?
How to update Node.js and NPM to next version ?
CSS to put icon inside an input element in a form
Roadmap to Become a Web Developer in 2022
Installation of Node.js on Linux
How to fetch data from an API in ReactJS ?
Top 10 Projects For Beginners To Practice HTML and CSS Skills
How to insert spaces/tabs in text using HTML/CSS?