Skip to content

Commit d50c38f

Browse files
authored
add form-check css class to checkbox (twbs#42406)
Update the Heroes example Remember me checkbox to use Bootstrap 5 form-check markup. Change container class to `form-check mb-3`, add `form-check-input` on the input with an `id` and `form-check-label` referencing that id. This improves Bootstrap compatibility and accessibility.
1 parent a583d9a commit d50c38f

1 file changed

Lines changed: 4 additions & 3 deletions

File tree

site/src/assets/examples/heroes/index.astro

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,10 @@ export const extra_css = ['heroes.css']
7474
<input type="password" class="form-control" id="floatingPassword" placeholder="Password">
7575
<label for="floatingPassword">Password</label>
7676
</div>
77-
<div class="checkbox mb-3">
78-
<label>
79-
<input type="checkbox" value="remember-me"> Remember me
77+
<div class="form-check mb-3">
78+
<input class="form-check-input" type="checkbox" id="checkDefault" value="remember-me">
79+
<label class="form-check-label" for="checkDefault">
80+
Remember me
8081
</label>
8182
</div>
8283
<button class="w-100 btn btn-lg btn-primary" type="submit">Sign up</button>

0 commit comments

Comments
 (0)