An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# ember-aria-switch

![Build and Deploy](https://github.com/rajasegar/ember-aria-switch/workflows/Build%20and%20Deploy/badge.svg)
[![Coverage Status](https://coveralls.io/repos/github/rajasegar/ember-aria-switch/badge.svg?branch=master)](https://coveralls.io/github/rajasegar/ember-aria-switch?branch=master)
[![semantic-release](https://img.shields.io/badge/%20%20%F0%9F%93%A6%F0%9F%9A%80-semantic--release-e10079.svg)](https://github.com/semantic-release/semantic-release)
[![npm version](http://img.shields.io/npm/v/ember-aria-switch.svg?style=flat)](https://npmjs.org/package/ember-aria-switch "View this project on npm")
[![EmberObserver](http://emberobserver.com/badges/ember-aria-switch.svg?branch=master)](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 .