|
1 | 1 | --- |
2 | | -title: Docs |
| 2 | +title: Checkbox |
3 | 3 | --- |
4 | 4 |
|
5 | | -[Internal Link](/docs), [External Link](https://vuejs.org) |
| 5 | +The Quasar Checkbox component is another basic element for user input. You can use this to supply a way for the user to toggle an option. |
6 | 6 |
|
7 | | -Lorem ipsum dolor sit amet, consectetur adipiscing elit. Integer non laoreet eros. `token` Morbi non ipsum ac purus dignissim rutrum. Nulla nec ante congue, rutrum tortor facilisis, aliquet ligula. Fusce vitae odio elit. `/quasar.conf.js` |
| 7 | +::: tip |
| 8 | +Please also refer to the [QOptionGroup](/vue-components/option-group) on other possibilities for creating groups of Checkboxes. |
| 9 | +::: |
8 | 10 |
|
9 | | -## Heading 2 |
10 | | -### Heading 3 |
11 | | -#### Heading 4 |
12 | | -##### Heading 5 |
13 | | -###### Heading 6 |
14 | 11 |
|
15 | | -``` |
16 | | -const m = 'lala' |
17 | | -``` |
| 12 | +## Installation |
| 13 | +<doc-installation components="QCheckbox" /> |
18 | 14 |
|
19 | | -```html |
20 | | -<div> |
21 | | - <q-btn @click="doSomething">Do something</q-btn> |
22 | | - <q-icon name="alarm" /> |
23 | | -</div> |
24 | | -``` |
| 15 | +## Usage |
| 16 | +<doc-example title="Standard" file="QCheckbox/Standard" /> |
25 | 17 |
|
26 | | -```vue |
27 | | -<template> |
28 | | - <!-- you define your Vue template here --> |
29 | | -</template> |
| 18 | +In the example below, we are using the `label` property to assign text to the checkbox. In the second row in the example below, the property `left-label` is being used to display the text on the left-side of the checkbox. |
30 | 19 |
|
31 | | -<script> |
32 | | -// This is where your Javascript goes |
33 | | -// to define your Vue component, which |
34 | | -// can be a Layout, a Page or your own |
35 | | -// component used throughout the app. |
| 20 | +<doc-example title="Label" file="QCheckbox/Label" /> |
36 | 21 |
|
37 | | -export default { |
38 | | - // |
39 | | -} |
40 | | -</script> |
| 22 | +In the example below, we are using the `color` property to assign color to the checkbox. In the second row in the example below, the property `keep-color` is being used to retain the passed in color when the checkbox is not in a toggled state. |
41 | 23 |
|
42 | | -<style> |
43 | | -/* This is where your CSS goes */ |
44 | | -</style> |
45 | | -``` |
| 24 | +<doc-example title="Coloring" file="QCheckbox/Coloring" /> |
46 | 25 |
|
47 | | -| Table Example | Type | Description | |
48 | | -| --- | --- | --- | |
49 | | -| infinite | Boolean | Infinite slides scrolling | |
50 | | -| size | String | Thickness of loading bar. | |
| 26 | +<doc-example title="Dense" file="QCheckbox/Dense" /> |
51 | 27 |
|
52 | | -> Something... |
| 28 | +<doc-example title="On Dark Background" file="QCheckbox/OnDarkBackground" dark /> |
53 | 29 |
|
54 | | -::: tip |
55 | | -Some tip |
56 | | -::: |
| 30 | +In the example below, the checkbox is using the property `toggle-indeterminate`. When used, you can optionally set the property `indeterminate-value`, otherwise the indeterminate value will be `null`. |
| 31 | +<doc-example title="Indeterminate State" file="QCheckbox/IndeterminateState" /> |
57 | 32 |
|
58 | | -::: warning |
59 | | -Some tip |
60 | | -::: |
| 33 | +<doc-example title="Array as Model" file="QCheckbox/ArrayAsModel" /> |
61 | 34 |
|
62 | | -::: danger |
63 | | -Some tip |
64 | | -::: |
65 | | - |
66 | | -::: warning CUSTOM TITLE |
67 | | -Some tip |
68 | | -::: |
| 35 | +<doc-example title="Custom Model Values" file="QCheckbox/CustomModel" /> |
69 | 36 |
|
70 | | -* Something |
71 | | - * something |
72 | | - * else |
73 | | -* Back |
74 | | - * wee |
| 37 | +> In the example below, we are rendering a `<label>` tag (notice `tag="label"`) so the QCheckbox will respond to clicks on QItems to change toggle state. |
75 | 38 |
|
76 | | -## Installation |
77 | | -<doc-installation components="QBtn" :plugins="['Meta', 'Cookies']" directives="Ripple" :config="{ notify: 'Notify' }" /> |
78 | | - |
79 | | -## Usage |
80 | | -<doc-example title="Standard" file="QBtn/Standard" /> |
| 39 | +<doc-example title="In a List" file="QCheckbox/InaList" /> |
81 | 40 |
|
82 | 41 | ## API |
83 | | -<doc-api file="QTh" /> |
| 42 | +<doc-api file="QCheckbox" /> |
0 commit comments