@@ -36,17 +36,19 @@ export default {
36
36
``` html
37
37
<template >
38
38
<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 >
50
52
<hr >
51
53
<div >Selected: <strong >{{ selected }}</strong ></div >
52
54
</div >
@@ -88,13 +90,15 @@ options (value array) to `<b-form-checkboxes>`.
88
90
``` html
89
91
<template >
90
92
<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 >
98
102
</div >
99
103
</template >
100
104
@@ -139,7 +143,7 @@ checkboxes are related.
139
143
140
144
Whenever using multple checkboxes, it is recommended that the ` <b-form-check-group> `
141
145
be 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.
143
147
144
148
## Button style checkboxes
145
149
Render 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.
153
157
``` html
154
158
<template >
155
159
<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 >
174
179
</div >
175
180
</template >
176
181
@@ -207,11 +212,13 @@ chechbox input by setting the `plain` prop.
207
212
``` html
208
213
<template >
209
214
<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 >
212
218
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 >
215
222
</div >
216
223
</template >
217
224
@@ -312,30 +319,34 @@ export default {
312
319
** Indeterminate checkbox use-case:**
313
320
``` html
314
321
<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 >
334
345
Selected: <strong >{{ selected }}</strong ><br >
335
346
All Selected: <strong >{{ allSelected }}</strong ><br >
336
347
Indeterminate: <strong >{{ indeterminate }}</strong ><br >
337
348
</p >
338
- </b-card >
349
+ </div >
339
350
</template >
340
351
341
352
<script >
0 commit comments