Performance: Form layout (inline, horizontal)
MEDIUM IMPACT
This affects how quickly the form content appears and how smoothly the browser renders form elements on different screen sizes.
<form class="row g-3 align-items-center"> <div class="col-auto"> <label for="name" class="col-form-label">Name</label> </div> <div class="col-auto"> <input type="text" id="name" class="form-control"> </div> <div class="col-auto"> <label for="email" class="col-form-label">Email</label> </div> <div class="col-auto"> <input type="email" id="email" class="form-control"> </div> </form>
<form> <label>Name</label> <input type="text"> <label>Email</label> <input type="email"> </form>
| Pattern | DOM Operations | Reflows | Paint Cost | Verdict |
|---|---|---|---|---|
| Vertical stacked form (no grid) | Low (few nodes) | Multiple on resize | High due to vertical stacking | [X] Bad |
| Bootstrap horizontal form (grid + inline) | Moderate (grid divs) | Single on resize | Low due to efficient layout | [OK] Good |