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
For more information on using `@nuxtjs/composition-api` read [their documentation](https://composition-api.nuxtjs.org/).
152
+
153
+
## Support
154
+
155
+
Join our [Discord channel](https://discord.gg/WhX2nG6GTQ) or [open an issue](https://github.com/vueform/toggle/issues).
156
+
157
+
## Basic props
158
+
159
+
| Name | Type | Default | Description |
160
+
| --- | --- | --- | --- |
161
+
|**id**|`string`|`toggle`| The `id` attribute of input field. Make sure to customize when using more toggles on a single page. |
162
+
|**name**|`string`|`toggle`| The `name` attribute of input field. |
163
+
|**disabled**|`boolean`|`false`| Whether the toggle should be disabled. |
164
+
|**required**|`boolean`|`false`| Whether the HTML5 required attribute should be used for toggle (using an invisible fake input). |
165
+
|**falseValue**|`string\|number\|boolean`|`false`| The value when the toggle is `off`. |
166
+
|**trueValue**|`string\|number\|boolean`|`true`| The value when toggle is `on`. |
167
+
|**offLabel**|`string`|| The label when toggle is `off`. |
168
+
|**onLabel**|`string`|| The label when toggle is `on`. |
169
+
|**labelledby**|`string`|| The `aria-labelledby` attribute. |
170
+
|**describedby**|`string`|| The `aria-describedby` attribute. |
171
+
|**classes**|`object`|| An object of class names that gets merged with the default values. Default: `{`<br> `container: 'toggle-container',`<br> `toggle: 'toggle',`<br> `toggleOn: 'toggle-on',`<br> `toggleOff: 'toggle-off',`<br> `toggleOnDisabled: 'toggle-on-disabled',`<br> `toggleOffDisabled: 'toggle-off-disabled',`<br> `handle: 'toggle-handle',`<br> `handleOn: 'toggle-handle-on',`<br> `handleOff: 'toggle-handle-off',`<br> `handleOnDisabled: 'toggle-handle-on-disabled',`<br> `handleOffDisabled: 'toggle-handle-off-disabled',`<br> `label: 'toggle-label',`<br>`}`.<br> The default value can be used with `default.css` and style can be customized with [CSS variables](#styling-with-css-vars). Alternatively this can be overridden with utility classes like [Tailwind CSS](#styling-with-tailwind-css). |
172
+
173
+
## Events
174
+
175
+
| Event | Attributes | Description |
176
+
| --- | --- | --- |
177
+
|**@change**|`value`| Emitted when the toggle changes. |
178
+
179
+
## Slots
180
+
181
+
| Slot | Attributes | Description |
182
+
| --- | --- | --- |
183
+
|**label**|`checked`, `classList`| The label of the toggle element. The `checked` attribute determines whether the toggle is *on* or *off* so you can display the label accordingly. The `classList` contains the resolved class names. |
184
+
151
185
## Styling with CSS vars
152
186
153
187
The following CSS variables can be used to customize toggle when using `default.css`:
@@ -225,7 +259,7 @@ The `Toggle` component accepts a `classes` property which allows to override def
225
259
}" />
226
260
```
227
261
228
-
Certain classes has different states which are merged to the base class when the state is active. For exmple`handle` will be merged with `handleOn` when the toggle is **on** and **not disabled** resulting in the following classes:
262
+
Certain classes has different states which are merged to the base class when the state is active. For example`handle` will be merged with `handleOn` when the toggle is **on** and **not disabled** resulting in the following classes:
@@ -244,38 +278,6 @@ By default the `on` and `off` labels are being read by the screenreaders. If you
244
278
<small id="toggle-description">Turn this on if you'd like to receive in-app notifications.</small>
245
279
```
246
280
247
-
## Support
248
-
249
-
Join our [Discord channel](https://discord.gg/WhX2nG6GTQ) or [open an issue](https://github.com/vueform/toggle/issues).
250
-
251
-
## Basic props
252
-
253
-
| Name | Type | Default | Description |
254
-
| --- | --- | --- | --- |
255
-
|**id**|`string`|`toggle`| The `id` attribute of input field. Make sure to customize when using more toggles on a single page. |
256
-
|**name**|`string`|`toggle`| The `name` attribute of input field. |
257
-
|**disabled**|`boolean`|`false`| Whether the toggle should be disabled. |
258
-
|**required**|`boolean`|`false`| Whether the HTML5 required attribute should be used for toggle (using an invisible fake input). |
259
-
|**falseValue**|`string\|number\|boolean`|`false`| The value when the toggle is `off`. |
260
-
|**trueValue**|`string\|number\|boolean`|`true`| The value when toggle is `on`. |
261
-
|**offLabel**|`string`|| The label when toggle is `off`. |
262
-
|**onLabel**|`string`|| The label when toggle is `on`. |
263
-
|**labelledby**|`string`|| The `aria-labelledby` attribute. |
264
-
|**describedby**|`string`|| The `aria-describedby` attribute. |
265
-
|**classes**|`object`|| An object of class names that gets merged with the default values. Default: `{`<br> `container: 'toggle-container',`<br> `toggle: 'toggle',`<br> `toggleOn: 'toggle-on',`<br> `toggleOff: 'toggle-off',`<br> `toggleOnDisabled: 'toggle-on-disabled',`<br> `toggleOffDisabled: 'toggle-off-disabled',`<br> `handle: 'toggle-handle',`<br> `handleOn: 'toggle-handle-on',`<br> `handleOff: 'toggle-handle-off',`<br> `handleOnDisabled: 'toggle-handle-on-disabled',`<br> `handleOffDisabled: 'toggle-handle-off-disabled',`<br> `label: 'toggle-label',`<br>`}`.<br> The default value can be used with `default.css` and style can be customized with [CSS variables](#styling-with-css-vars). Alternatively this can be overridden with utility classes like [Tailwind CSS](#styling-with-tailwind-css). |
266
-
267
-
## Events
268
-
269
-
| Event | Attributes | Description |
270
-
| --- | --- | --- |
271
-
|**@change**|`value`| Emitted when the toggle changes. |
272
-
273
-
## Slots
274
-
275
-
| Slot | Attributes | Description |
276
-
| --- | --- | --- |
277
-
|**label**|`checked`, `classList`| The label of the toggle element. The `checked` attribute determines whether the toggle is *on* or *off* so you can display the label accordingly. The `classList` contains the resolved class names. |
0 commit comments