Document toggle button webcomponent
authorMarcel Werk <burntime@woltlab.com>
Fri, 15 Nov 2024 15:48:18 +0000 (16:48 +0100)
committerMarcel Werk <burntime@woltlab.com>
Fri, 15 Nov 2024 15:48:18 +0000 (16:48 +0100)
Closes #479

docs/javascript/components_toggle_button.md [new file with mode: 0644]
mkdocs.yml

diff --git a/docs/javascript/components_toggle_button.md b/docs/javascript/components_toggle_button.md
new file mode 100644 (file)
index 0000000..3c84ff4
--- /dev/null
@@ -0,0 +1,29 @@
+# Toggle Button
+
+A toggle button is a control used for switching (or toggling) between two states or options. 
+
+## Example
+
+```html
+<label>
+    <woltlab-core-toggle-button name="foo" checked></woltlab-core-toggle-button>
+    Toggle Button Description ...
+</label>
+```
+
+## Parameters
+
+### `checked`
+
+Indicates that the button is active.
+
+### `name`
+
+The name of the button.
+If the button is part of a form, the name is used to transmit the value when the form is sent.
+
+### `value`
+
+The value that should be transmitted when the form is sent if the button is active.
+
+Defaults to `1`.
index 75acd5a374f04c2c388854541aebb6b4397738e7..cc7b9a7f68b6664fe941ca5978722350265c8380 100644 (file)
@@ -69,6 +69,7 @@ nav:
           - 'Notices': 'javascript/components_notice.md'
           - 'Pagination': 'javascript/components_pagination.md'
           - 'RPC API': 'javascript/components_rpc_api.md'
+          - 'Toggle Button': 'javascript/components_toggle_button.md'
       - 'New API':
           - 'Writing a module': 'javascript/new-api_writing-a-module.md'
           - 'Core Functions': 'javascript/new-api_core.md'