@@ -15,7 +15,7 @@ Switches work by layering an invisible checkbox over the custom switch indicator
1515Switches also include the ` switch ` attribute for browsers that support it. This provides haptic feedback when toggling the switch.
1616
1717<Example code = { ` <div class="switch">
18- <input type="checkbox" value="" id="switch" switch>
18+ <input type="checkbox" value="" id="switch" role="switch" switch>
1919 </div> ` } />
2020
2121## Label
@@ -26,14 +26,14 @@ Consider margin utilities for additional spacing, and flex utilities for alignme
2626
2727<Example class = " d-flex flex-column gap-3" code = { ` <b-checkgroup>
2828 <div class="switch switch-sm mt-1">
29- <input type="checkbox" value="" id="switchSmLabel" switch>
29+ <input type="checkbox" value="" id="switchSmLabel" role="switch" switch>
3030 </div>
3131 <label for="switchSmLabel">Small switch</label>
3232 </b-checkgroup>
3333
3434 <b-checkgroup>
3535 <div class="switch">
36- <input type="checkbox" value="" id="switchMdLabel" switch>
36+ <input type="checkbox" value="" id="switchMdLabel" role="switch" switch>
3737 </div>
3838 <label for="switchMdLabel">Default switch</label>
3939 </b-checkgroup> ` } />
@@ -44,7 +44,7 @@ Modify the appearance of checked checkboxes by adding the `.checked-{color}` cla
4444
4545<Example class = " d-flex flex-column gap-2" code = { getData (' theme-colors' ).map ((themeColor ) => ` <b-checkgroup>
4646 <div class="switch switch-sm mt-1 checked-${themeColor .name }">
47- <input type="checkbox" value="" id="switch${themeColor .name }" switch checked>
47+ <input type="checkbox" value="" id="switch${themeColor .name }" role="switch" switch checked>
4848 </div>
4949 <label for="switch${themeColor .name }">Example ${themeColor .name } switch</label>
5050 </b-checkgroup> ` )} />
@@ -55,7 +55,7 @@ Add the `disabled` attribute and the associated `<label>`s are automatically sty
5555
5656<Example class = " d-flex flex-column gap-3" code = { ` <b-checkgroup>
5757 <div class="switch">
58- <input type="checkbox" value="" id="switchDisabledLabel" switch disabled>
58+ <input type="checkbox" value="" id="switchDisabledLabel" role="switch" switch disabled>
5959 </div>
6060 <label for="switchDisabledLabel">Disabled switch</label>
6161 </b-checkgroup> ` } />
@@ -65,13 +65,13 @@ Add the `disabled` attribute and the associated `<label>`s are automatically sty
6565Add a size modifier class to make your switch appear smaller or larger.
6666
6767<Example class = " d-flex flex-column gap-3" code = { ` <div class="switch switch-sm">
68- <input type="checkbox" value="" id="switchSizeSm" switch>
68+ <input type="checkbox" value="" id="switchSizeSm" role="switch" switch>
6969 </div>
7070 <div class="switch">
71- <input type="checkbox" value="" id="switchSizeMd" switch>
71+ <input type="checkbox" value="" id="switchSizeMd" role="switch" switch>
7272 </div>
7373 <div class="switch switch-lg">
74- <input type="checkbox" value="" id="switchSizeLg" switch>
74+ <input type="checkbox" value="" id="switchSizeLg" role="switch" switch>
7575 </div> ` } />
7676
7777## CSS
0 commit comments