Forms

Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.

Form controls

Give textual form controls like <input>s and <textarea>s an upgrade with custom styles, sizing, focus states, and more.

Example

We'll never share your email with anyone else.
              
  
              
            

Sizing

              
  
              
            

Disabled

              
  
              
            

File input

              
  
              
            

Form text

Your password must be 8-20 characters long, contain letters and numbers, and must not contain spaces, special characters, or emoji.

Must be 8-20 characters long.
              
  
              
            

Color

              
  
              
            

Floating labels

Create beautifully simple form labels that float over your input fields.

Example



              
  
              
            

Selects

              
  
              
            

Textarea


              
  
              
            

Select

Customize the native <select>s with custom CSS that changes the element’s initial appearance.

Default

              
  
              
            

Sizing

              
  
              
            

Disabled

              
  
              
            

Checks and radios

Create consistent cross-browser and cross-device checkboxes and radios with our completely rewritten checks component.

Checks

              
  
              
            

Radios

              
  
              
            

Switches

              
  
              
            

Inline layout

              
  
              
            

Toggle buttons

Create button-like checkboxes and radio buttons by using .btn styles rather than .form-check-label on the <label> elements. These toggle buttons can further be grouped in a button group if needed.

Checkbox toggle buttons

              
  
              
            

Radio toggle buttons

              
  
              
            

Range

Use our custom range inputs for consistent cross-browser styling and built-in customization.

Range basic


              
  
              
            

Min and max

Range inputs have implicit values for min and max0 and 100, respectively. You may specify new values for those using the min and max attributes.

              
  
              
            

Steps

By default, range inputs “snap” to integer values. To change this, you can specify a step value. In the example below, we double the number of steps by using step="0.5".

              
  
              
            

Input group

Easily extend form controls by adding text, buttons, or button groups on either side of textual inputs, custom selects, and custom file inputs.

Basic

@
@example.com
https://example.com/users/
$ .00
@
With textarea
              
  
              
            

Sizing

Small
Default
Large
              
  
              
            

Checkboxes and radios

              
  
              
            

Multiple inputs

Full name
              
  
              
            

Multiple addons

http:// mystore.shop/
.mystore .shop
              
  
              
            

Button addons

              
  
              
            

Button with dropdowns

              
  
              
            

Segmented buttons

              
  
              
            

Custom select

              
  
              
            

Custom file input

              
  
              
            

Validations

Provide valuable, actionable feedback to your users with HTML5 form validation, via browser default behaviors or custom styles and JavaScript.

Example

For custom Bootstrap form validation messages, you’ll need to add the novalidate boolean attribute to your <form>. This disables the browser default feedback tooltips, but still provides access to the form validation APIs in JavaScript. Try to submit the form below; our JavaScript will intercept the submit button and relay feedback to you. When attempting to submit, you’ll see the :invalid and :valid styles applied to your form controls.

Custom feedback styles apply custom colors, borders, focus styles, and background icons to better communicate feedback. Background icons for <select>s are only available with .form-select, and not .form-control.

Looks good!
Looks good!
@
Please choose a username.
Please provide a valid city.
Please select a valid state.
Please provide a valid zip.
You must agree before submitting.
              
  
              
            

Tooltips style

If your form layout allows it, you can swap the .{valid|invalid}-feedback classes for .{valid|invalid}-tooltip classes to display validation feedback in a styled tooltip. Be sure to have a parent with position: relative on it for tooltip positioning. In the example below, our column classes have this already, but your project may require an alternative setup.

Looks good!
Looks good!
@
Please choose a unique and valid username.
Please provide a valid city.
Please select a valid state.
Please provide a valid zip.