Stacked Form (Default)
By default, each field is under the previous one. It is simple and works well on phones.
Form with the Grid
Put form fields inside columns to place them side by side.
html
<form class="row g-3">
<div class="col-md-6">
<label for="first" class="form-label">First name</label>
<input type="text" class="form-control" id="first">
</div>
<div class="col-md-6">
<label for="last" class="form-label">Last name</label>
<input type="text" class="form-control" id="last">
</div>
<div class="col-12">
<label for="address" class="form-label">Address</label>
<input type="text" class="form-control" id="address" placeholder="1234 Main St">
</div>
<div class="col-md-6">
<label for="city" class="form-label">City</label>
<input type="text" class="form-control" id="city">
</div>
<div class="col-md-4">
<label for="state" class="form-label">State</label>
<select id="state" class="form-select"><option>Choose...</option></select>
</div>
<div class="col-md-2">
<label for="zip" class="form-label">Zip</label>
<input type="text" class="form-control" id="zip">
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Register</button>
</div>
</form>
Result
Names side by side on a laptop, a full-width address and a three-field row for city, state and zip. On a phone everything stacks.
Horizontal Form
The label sits on the left and the input on the right. Use col-form-label on the label so it aligns with the input text.
html
<form>
<div class="row mb-3">
<label for="hEmail" class="col-sm-3 col-form-label">Email</label>
<div class="col-sm-9">
<input type="email" class="form-control" id="hEmail">
</div>
</div>
<div class="row mb-3">
<label for="hPass" class="col-sm-3 col-form-label">Password</label>
<div class="col-sm-9">
<input type="password" class="form-control" id="hPass">
</div>
</div>
<button type="submit" class="btn btn-primary">Sign in</button>
</form>
Inline Form (Auto-sizing)
html
<form class="row row-cols-lg-auto g-3 align-items-center">
<div class="col-12">
<input type="text" class="form-control" placeholder="Username">
</div>
<div class="col-12">
<input type="password" class="form-control" placeholder="Password">
</div>
<div class="col-12">
<button type="submit" class="btn btn-primary">Login</button>
</div>
</form>
The fields stack on phones and sit in one line from the large breakpoint.
UX tip: Single-column forms are usually the easiest to complete. Use multiple columns only for short, related fields such as city and zip.
Conclusion
The grid gives you complete freedom to arrange forms. Choose the stacked layout for simple forms and the grid for long registration forms.
Quick Summary: Use row g-3 with col-md-* for grid forms, col-form-label for horizontal forms, and row-cols-lg-auto for inline forms.