Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Document toggle button webcomponent #481

Open
wants to merge 1 commit into
base: 6.2
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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