We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent b6be6cd commit ba64ef7Copy full SHA for ba64ef7
docs/javascript/components_toggle_button.md
@@ -34,3 +34,13 @@ Defaults to `1`.
34
35
The custom event `change` is fired on the toggle button whenever the `checked` property of the button changes.
36
The event detail contains `{ checked: boolean }`, alternatively the property `checked` can be queried to fetch the current state.
37
+
38
+Example:
39
40
+```ts
41
+document.getElementId("toggle-button-id").addEventListener("change", (event: CustomEvent) => {
42
+ if (event.detail.checked) {
43
+ // button is checked
44
+ }
45
+});
46
+```
0 commit comments