You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: src/guides/v2.2/ui_comp_guide/components/ui-checkbox.md
+22-58Lines changed: 22 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -7,68 +7,32 @@ The Checkbox component implements a form field that is an [HTML](https://glossar
7
7
8
8
## Configuration options
9
9
10
-
<table>
11
-
<tr>
12
-
<th>Option </th>
13
-
<th>Description</th>
14
-
<th>Type</th>
15
-
<th>Default</th>
16
-
</tr>
17
-
<tr>
18
-
<td><code>checked</code></td>
19
-
<td>Initial checkbox state (selected or cleared). If <code>false</code>, the checkbox is cleared. If <code>true</code>, the checkbox is selected.</td>
20
-
<td>Boolean</td>
21
-
<td><code>false</code></td>
22
-
</tr>
23
-
<tr>
24
-
<td><code>multiple</code></td>
25
-
<td>Renders multiple elements.</td>
26
-
<td>Boolean</td>
27
-
<td><code>false</code></td>
28
-
</tr>
29
-
<tr>
30
-
<td><code>prefer</code></td>
31
-
<td>The input type of the element to be rendered. Can be either radio button, checkbox, or toggle key. Changing this value also changes the <code>elementTmpl</code>, originally defined in the parent (<code>abstract</code>) component.</td>
32
-
<td>String</td>
33
-
<td><code>checkbox</code></td>
34
-
</tr>
35
-
<tr>
36
-
<td><code>valueMap</code></td>
37
-
<td>Convert the component's value to the expected type. For example, you can set to convert '0' to 'false', this would look like following:<code><br />{<br />'0': false<br />}</code></td>
38
-
<td>Object</td>
39
-
<td><code>{}</code></td>
40
-
</tr>
41
-
<tr>
42
-
<td><code>templates</code>
43
-
<ul>
44
-
<li><code>radio</code></li>
45
-
<li><code>checkbox</code></li>
46
-
<li><code>toggle</code></li>
47
-
</ul>
48
-
</td>
49
-
<td>Paths to templates for all possible types of input elements. The exact template to be used for rendering is defined by the <code>prefer</code> property.</td>
<td>The path to the component’s <code>.html</code> template.</td>
62
-
<td>String</td>
63
-
<td><code>ui/form/field</code></td>
64
-
</tr>
65
-
</table>
10
+
| Option | Description | Type | Default |
11
+
| --- | --- | --- | --- |
12
+
|`checked`| Initial checkbox state (selected or cleared). If `false`, the checkbox is cleared. If `true`, the checkbox is selected. | Boolean |`false`|
13
+
|`component`| The path to the component’s `.js` file in terms of RequireJS. | String |`Magento_Ui/js/form/element/single-checkbox`|
14
+
|`label`| Label to be displayed in the field. | String |`''`|
|`prefer`| The input type of the element to be rendered. Can be either radio button, checkbox, or toggle key. Changing this value also changes the `elementTmpl`, originally defined in the parent (`abstract`) component. | String (`radio`\|`checkbox`\|`toggle`) |`checkbox`|
17
+
|`template`| The path to the component’s `.html` template. | String |`ui/form/field`|
18
+
|`templates`| Paths to templates for all possible types of input elements. The exact template to be used for rendering is defined by the `prefer` property. | Object |`{radio: 'ui/form/components/single/radio', checkbox: 'ui/form/components/single/checkbox', toggle: 'ui/form/components/single/switcher'}`|
19
+
|`valueMap`| Convert the component's value to the expected type. For example, you can set to convert '0' to 'false', this would look like following: <br />`{'0': false}`| Object |`{}`|
0 commit comments