Basic Forms
Tabs styles and versionsForm controls
Textual form controls—like <input>s, <select>s, and <textarea>s—are styled with the .form-controlclass. Included are styles for general appearance, focus state, sizing, and more.
Be sure to explore our custom formsto further style <select>s.
For file inputs, swap the .form-controlfor .form-control-file.
Sizing
Set heights using classes like .form-control-lgand .form-control-sm.
Add the readonlyboolean 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.
If you want to have <input readonly>elements in your form styled as plain text, use the .form-control-plaintextclass to remove the default form field styling and preserve the correct margin and padding.
Custom checkboxes can also utilize the :indeterminatepseudo class when manually set via JavaScript (there is no available HTML attribute for specifying it).
Custom checkboxes and radios can also be disabled. Add the disabledboolean attribute to the <input>and the custom indicator and label description will be automatically styled.
A switch has the markup of a custom checkbox but uses the .custom-switchclass to render a toggle switch. Switches also support the disabledattribute.
Create custom <input type="range">controls with .custom-range. The track (the background) and thumb (the value) are both styled to appear the same across browsers. As only IE and Firefox support “filling” their track from the left or right of the thumb as a means to visually indicate progress, we do not currently support it.
Range inputs have implicit values for minand max—0and 100, respectively. You may specify new values for those using the minand maxattributes.
By default, range inputs “snap” to integer values. To change this, you can specify a stepvalue. In the example below, we double the number of steps by using step="0.5".
For custom Bootstrap form validation messages, you’ll need to add the novalidateboolean 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 :invalidand :validstyles 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 .custom-select, and not .form-control.
Browser defaults
Not interested in custom validation feedback messages or writing JavaScript to change form behaviors? All good, you can use the browser defaults. Try submitting the form below. Depending on your browser and OS, you’ll see a slightly different style of feedback.
While these feedback styles cannot be styled with CSS, you can still customize the feedback text through JavaScript.
Server side
We recommend using client-side validation, but in case you require server-side validation, you can indicate invalid and valid form fields with .is-invalidand .is-valid. Note that .invalid-feedbackis also supported with these classes.
Supported elements
Validation styles are available for the following form controls and components:
- <input>s and- <textarea>s with- .form-control(including up to one- .form-controlin input groups)
- <select>s with- .form-selector- .custom-select
- .form-checks
- .custom-checkboxs and- .custom-radios
- .custom-file
Tooltips
If your form layout allows it, you can swap the .{valid|invalid}-feedbackclasses for .{valid|invalid}-tooltipclasses to display validation feedback in a styled tooltip. Be sure to have a parent with position: relativeon it for tooltip positioning. In the example below, our column classes have this already, but your project may require an alternative setup.




