Skip to content

Commit 01e8dfb

Browse files
authored
Merge pull request #481 from WoltLab/toggle-button
Document toggle button webcomponent
2 parents e089b26 + 3addc7b commit 01e8dfb

File tree

2 files changed

+30
-0
lines changed

2 files changed

+30
-0
lines changed
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
1+
# Toggle Button
2+
3+
A toggle button is a control used for switching (or toggling) between two states or options.
4+
5+
## Example
6+
7+
```html
8+
<label>
9+
<woltlab-core-toggle-button name="foo" checked></woltlab-core-toggle-button>
10+
Toggle Button Description ...
11+
</label>
12+
```
13+
14+
## Parameters
15+
16+
### `checked`
17+
18+
Indicates that the button is active.
19+
20+
### `name`
21+
22+
The name of the button.
23+
If the button is part of a form, the name is used to transmit the value when the form is sent.
24+
25+
### `value`
26+
27+
The value that should be transmitted when the form is sent if the button is active.
28+
29+
Defaults to `1`.

mkdocs.yml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -69,6 +69,7 @@ nav:
6969
- 'Notices': 'javascript/components_notice.md'
7070
- 'Pagination': 'javascript/components_pagination.md'
7171
- 'RPC API': 'javascript/components_rpc_api.md'
72+
- 'Toggle Button': 'javascript/components_toggle_button.md'
7273
- 'New API':
7374
- 'Writing a module': 'javascript/new-api_writing-a-module.md'
7475
- 'Core Functions': 'javascript/new-api_core.md'

0 commit comments

Comments
 (0)