@@ -36,17 +36,19 @@ export default {
3636``` html
3737<template >
3838 <div >
39- <h5 >Using options array:</h5 >
40- <b-form-checkbox-group id =" checkboxes1" name =" flavour1" v-model =" selected" :options =" options" >
41- </b-form-checkbox-group >
42-
43- <h5 class =" mt-3" >Using sub-components:</h5 >
44- <b-form-checkbox-group id =" checkboxes2" name =" flavour2" v-model =" selected" >
45- <b-form-checkbox value =" orange" >Orange</b-form-checkbox >
46- <b-form-checkbox value =" apple" >Apple</b-form-checkbox >
47- <b-form-checkbox value =" pineapple" >Pineapple</b-form-checkbox >
48- <b-form-checkbox value =" grape" >Grape</b-form-checkbox >
49- </b-form-checkbox-group >
39+ <b-form-group label =" Using <code>options</code> array:" >
40+ <b-form-checkbox-group id =" checkboxes1" name =" flavour1" v-model =" selected" :options =" options" >
41+ </b-form-checkbox-group >
42+ </b-form-group >
43+
44+ <b-form-group label =" Using sub-components:" >
45+ <b-form-checkbox-group id =" checkboxes2" name =" flavour2" v-model =" selected" >
46+ <b-form-checkbox value =" orange" >Orange</b-form-checkbox >
47+ <b-form-checkbox value =" apple" >Apple</b-form-checkbox >
48+ <b-form-checkbox value =" pineapple" >Pineapple</b-form-checkbox >
49+ <b-form-checkbox value =" grape" >Grape</b-form-checkbox >
50+ </b-form-checkbox-group >
51+ </b-form-group >
5052 <hr >
5153 <div >Selected: <strong >{{ selected }}</strong ></div >
5254 </div >
@@ -88,13 +90,15 @@ options (value array) to `<b-form-checkboxes>`.
8890``` html
8991<template >
9092 <div >
91- <h5 >Inline checkboxes (default)</h5 >
92- <b-form-checkbox-group v-model =" selected" name =" flavour1" :options =" options" >
93- </b-form-checkbox-group >
94-
95- <h5 class =" mt-3" >Stacked checkboxes</h5 >
96- <b-form-checkbox-group stacked v-model =" selected" name =" flavour2" :options =" options" >
97- </b-form-checkbox-group >
93+ <b-form-group label =" Inline checkboxes (default)" >
94+ <b-form-checkbox-group v-model =" selected" name =" flavour1" :options =" options" >
95+ </b-form-checkbox-group >
96+ </b-form-group >
97+
98+ <b-form-group label =" Stacked checkboxes" >
99+ <b-form-checkbox-group stacked v-model =" selected" name =" flavour2" :options =" options" >
100+ </b-form-checkbox-group >
101+ </b-form-group >
98102 </div >
99103</template >
100104
@@ -139,7 +143,7 @@ checkboxes are related.
139143
140144Whenever using multple checkboxes, it is recommended that the ` <b-form-check-group> `
141145be placed in a [ ` <b-form-group> ` ] ( /docs/components/form-group ) component to
142- associate a ` < label> ` with the entire group of checkboxes.
146+ associate a label with the entire group of checkboxes.
143147
144148## Button style checkboxes
145149Render checkboxes with the look of a button by setting the prop ` buttons ` on ` <b-form-checkbox-group> ` .
@@ -153,24 +157,25 @@ when they are in the _checked_ state.
153157``` html
154158<template >
155159 <div >
156- <h5 >button style checkboxes</h5 >
157- <b-form-checkbox-group buttons v-model =" selected" name =" butons1" :options =" options" >
158- </b-form-checkbox-group >
159-
160- <h5 class =" mt-3" >
161- button style checkboxes with variant <code >primary</code > and large buttons
162- </h5 >
163- <b-form-checkbox-group v-model =" selected"
164- buttons
165- button-variant =" primary"
166- size =" lg"
167- name =" buttons2"
168- :options =" options" >
169- </b-form-checkbox-group >
170-
171- <h5 class =" mt-3" >Stacked (vertical) button style checkboxes</h5 >
172- <b-form-checkbox-group buttons v-model =" selected" stacked :options =" options" >
173- </b-form-checkbox-group >
160+ <b-form-group label =" Button style checkboxes" >
161+ <b-form-checkbox-group buttons v-model =" selected" name =" butons1" :options =" options" >
162+ </b-form-checkbox-group >
163+ </b-form-group >
164+
165+ <b-form-group label =" Button style checkboxes with variant <code>primary</code> and large buttons" >
166+ <b-form-checkbox-group v-model =" selected"
167+ buttons
168+ button-variant =" primary"
169+ size =" lg"
170+ name =" buttons2"
171+ :options =" options" >
172+ </b-form-checkbox-group >
173+ </b-form-group >
174+
175+ <b-form-group label =" Stacked (vertical) button style checkboxes" >
176+ <b-form-checkbox-group buttons v-model =" selected" stacked :options =" options" >
177+ </b-form-checkbox-group >
178+ </b-form-group >
174179 </div >
175180</template >
176181
@@ -207,11 +212,13 @@ chechbox input by setting the `plain` prop.
207212``` html
208213<template >
209214 <div >
210- <h5 >Plain inline checkboxes</h5 >
211- <b-form-checkbox-group plain v-model =" selected" :options =" options" />
215+ <b-form-group label =" Plain inline checkboxes" >
216+ <b-form-checkbox-group plain v-model =" selected" :options =" options" />
217+ </b-form-group >
212218
213- <h5 class =" mt-3" >Plain stacked checkboxes</h5 >
214- <b-form-checkbox-group plain stacked v-model =" selected" :options =" options" />
219+ <b-form-group label =" Plain stacked checkboxes" >
220+ <b-form-checkbox-group plain stacked v-model =" selected" :options =" options" />
221+ </b-form-group >
215222 </div >
216223</template >
217224
@@ -312,30 +319,34 @@ export default {
312319** Indeterminate checkbox use-case:**
313320``` html
314321<template >
315- <b-card >
316- <b-form-checkbox v-model =" allSelected"
317- :indeterminate =" indeterminate"
318- aria-describedby =" flavours"
319- aria-controls =" flavours"
320- @change =" toggleAll"
321- >
322- {{ allSelected ? 'Un-select' : 'Select' }}
323- All Flavors
324- </b-form-checkbox >
325- <b-form-checkbox-group id =" flavors"
326- stacked
327- v-model =" selected"
328- name =" flavs"
329- :options =" flavours"
330- class =" ml-3"
331- aria-label =" Individual flavours"
332- ></b-form-checkbox-group >
333- <p aria-live =" polite" >
322+ <div >
323+ <b-form-group >
324+ <template slot =" label" >
325+ <b >Choose your flavours:</b ><br >
326+ <b-form-checkbox v-model =" allSelected"
327+ :indeterminate =" indeterminate"
328+ aria-describedby =" flavours"
329+ aria-controls =" flavours"
330+ @change =" toggleAll"
331+ >
332+ {{ allSelected ? 'Un-select All' : 'Select All' }}
333+ </b-form-checkbox >
334+ </template >
335+ <b-form-checkbox-group id =" flavors"
336+ stacked
337+ v-model =" selected"
338+ name =" flavs"
339+ :options =" flavours"
340+ class =" ml-4"
341+ aria-label =" Individual flavours"
342+ ></b-form-checkbox-group >
343+ </b-form-group >
344+ <p >
334345 Selected: <strong >{{ selected }}</strong ><br >
335346 All Selected: <strong >{{ allSelected }}</strong ><br >
336347 Indeterminate: <strong >{{ indeterminate }}</strong ><br >
337348 </p >
338- </b-card >
349+ </div >
339350</template >
340351
341352<script >
0 commit comments