Skip to content

Commit

Permalink
Document toggle button webcomponent
Browse files Browse the repository at this point in the history
Closes #479
  • Loading branch information
BurntimeX committed Nov 15, 2024
1 parent e089b26 commit 3addc7b
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
29 changes: 29 additions & 0 deletions docs/javascript/components_toggle_button.md
Original file line number Diff line number Diff line change
@@ -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`.
1 change: 1 addition & 0 deletions mkdocs.yml
Original file line number Diff line number Diff line change
Expand Up @@ -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'
Expand Down

0 comments on commit 3addc7b

Please sign in to comment.