Examples and usage guidelines for form control styles, layout options, and custom components for creating a wide variety of forms.
Here’s a quick example to demonstrate Bootstrap’s form styles.
Textual form controls—like
<textarea>s—are styled with the
.form-control class. Included are styles for general appearance, focus state, sizing, and more.
readonly boolean attribute on an input to prevent modification of the input’s value. Read-only inputs appear lighter (just like disabled inputs), but retain the standard cursor.
Set horizontally scrollable range inputs using
Checkboxes and Radios
Checkboxes are for selecting one or several options in a list, while radios are for selecting one option from many.
.form-group class is the easiest way to add some structure to forms. It provides a flexible class that encourages proper grouping of labels, controls, optional help text, and form validation messaging.
More complex forms can be built using our grid classes. Use these for form layouts that require multiple columns, varied widths, and additional alignment options.
More complex layouts can also be created with the grid system.
Provide valuable, actionable feedback to your users with HTML5 form validation.
A switch has the markup of a custom checkbox but uses the
.custom-switch class to render a toggle switch. Switches also support the
<select> menus need only a custom class,
.custom-select to trigger the custom styles. Custom styles are limited to the
<select>’s initial appearance and cannot modify the
<option>s due to browser limitations.