Layout
Give your forms some structure—from inline to horizontal to custom grid implementations—with our form layout options.
Forms
Every group of form fields should reside in a
<Form>
element. Bootstrap
provides no default styling for the
<Form>
element, but there are some
powerful browser features that are provided by default.
<button>
s within a
<Form>
default to
type="submit"
, so strive to be
specific and always include a
type
.
<fieldset>
and setting the
disabled
attribute on it.
Since Bootstrap applies
display: block
and
width: 100%
to almost all our
form controls, forms will by default stack vertically. Additional classes can
be used to vary this layout on a per-form basis.
Form groups
The
FormGroup
component is the easiest way to add some structure to forms.
It provides a flexible container for grouping of labels, controls, optional
help text, and form validation messaging. Use it with
fieldset
s,
div
s,
or nearly any other element.
You also add the
controlId
prop to accessibly wire the nested label and
input together via the
id
.