INPUT TYPES
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.
A block of help text that breaks onto a new line and may extend beyond one line.
FLOATING LABELS
Most common form control, text-based input fields. Includes support for all HTML5 types: text, password, datetime, datetime-local, date, month, time, week, number, email, url, search, tel, and color.
SELECT
menus need only a custom class, .form-select to trigger the custom styles.
SWITCHES
A switch has the markup of a custom checkbox but uses the .form-switch class to render a toggle switch. Switches also support the disabled attribute.
CHECKBOXES
Each checkbox and radio input and label pairing is wrapped in a div to create our custom control. Structurally, this is the same approach as our default .form-check.
RADIOS
Each checkbox and radio input and label pairing is wrapped in a div to create our custom control. Structurally, this is the same approach as our default .form-check.
INPUT SIZES
Set heights using classes like .input-lg, and set widths using grid column classes like .col-lg-*.
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
Here’s a quick example to demonstrate Bootstrap’s form styles. Keep reading for documentation on required classes, form layout, and more.
HORIZONTAL FORM
Create horizontal forms with the grid by adding the .row class to form groups and using the .col-*-* classes to specify the width of your labels and controls. Be sure to add .col-form-label to your label s as well so they’re vertically centered with their associated form controls.
INLINE FORM
Use the .row-cols-lg-auto, .g-3 & .align-items-center class to display a series of labels, form controls, and buttons on a single horizontal row. Form controls within inline forms vary slightly from their default states. Controls only appear inline in viewports that are at least 576px wide to account for narrow viewports on mobile devices.
Auto-sizing
Auto-sizing
HORIZONTAL FORM LABEL SIZING
Be sure to use .col-form-label-sm or .col-form-label-lg to your label s or legend s to correctly follow the size of .form-control-lg and .form-control-sm.
FORM ROW
By adding .row & .g-2, you can have control over the gutter width in as well the inline as block direction.