https://github.com/rajasegar/ember-aria-switch
Ember ARIA switch button with accessibility
https://github.com/rajasegar/ember-aria-switch
a11y aria switch toggle toggle-buttons toggle-switches
Last synced: 7 months ago
JSON representation
Ember ARIA switch button with accessibility
- Host: GitHub
- URL: https://github.com/rajasegar/ember-aria-switch
- Owner: rajasegar
- License: mit
- Created: 2017-08-24T12:14:56.000Z (about 8 years ago)
- Default Branch: master
- Last Pushed: 2022-06-10T00:48:29.000Z (over 3 years ago)
- Last Synced: 2025-02-27T04:11:27.952Z (8 months ago)
- Topics: a11y, aria, switch, toggle, toggle-buttons, toggle-switches
- Language: JavaScript
- Homepage: http://rajasegar.github.io/ember-aria-switch/
- Size: 9.27 MB
- Stars: 5
- Watchers: 3
- Forks: 1
- Open Issues: 20
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# ember-aria-switch

[](https://coveralls.io/github/rajasegar/ember-aria-switch?branch=master)
[](https://github.com/semantic-release/semantic-release)
[](https://npmjs.org/package/ember-aria-switch "View this project on npm")
[](http://emberobserver.com/addons/ember-aria-switch)[ARIA Switch button](https://scottaohara.github.io/aria-switch-control/) in an Ember addon based on the WAI-ARIA specifications.
## Demo
[Demo](http://rajasegar.github.io/ember-aria-switch/)
## Installation
- `ember install ember-aria-switch`
## Usage
Example Markup:
```hbs
```
With external label
```hbs
Item 2```
With disabled state
```hbs
```
Without aria-label
```hbs
```
With custom on/off labels
```hbs
```
With toggle callback
```hbs
```
And your `toggleCallback` can be defined such as:
```js
export default class IndexController extends Controller{
@action
toggleCallback(toggleValue) {
let val = toggleValue ? "ON" : "OFF";
alert(`ARIA Switch: You turned me ${val}!`);
}
}```
## Running
- `ember serve`
- Visit your app at .## Running Tests
- `npm test` (Runs `ember try:each` to test your addon against multiple Ember versions)
- `ember test`
- `ember test --server`## Building
- `ember build`
For more information on using ember-cli, visit .