2.1.0 • Published 5 years ago

ember-aria-switch v2.1.0

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

ember-aria-switch

Build and Deploy Coverage Status semantic-release npm version EmberObserver

ARIA Switch button in an Ember addon based on the WAI-ARIA specifications.

Demo

Demo

Installation

  • ember install ember-aria-switch

Usage

Example Markup:

<AriaSwitch @label="My Label" @checked={{true}} />

With external label

<p id="ex_label">
  Item 2
</p>
<AriaSwitch @ariaLabelledBy="ex_label" />

With disabled state

<AriaSwitch @label="My Label" @disabled={{true}} />

Without aria-label

<AriaSwitch />

With custom on/off labels

<AriaSwitch @onLabel="Yes" @offLabel="No" />

With toggle callback

<AriaSwitch @onToggle={{this.toggleCallback}} />

And your toggleCallback can be defined such as:

export default class IndexController extends Controller{
    @action
    toggleCallback(toggleValue) {
      let val = toggleValue ? "ON" : "OFF";
      alert(`ARIA Switch: You turned me ${val}!`);
    }
}

Running

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 https://ember-cli.com/.

2.1.0

5 years ago

2.0.0

5 years ago

1.0.14

5 years ago

1.0.13

5 years ago

1.0.12

5 years ago

1.0.11

5 years ago

1.0.8

5 years ago

1.0.10

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

6 years ago

1.0.4

6 years ago

1.0.3

6 years ago

1.0.2

6 years ago

1.0.1

7 years ago

0.1.6

8 years ago

0.1.5

8 years ago

0.1.4

8 years ago

0.1.3

8 years ago

0.1.2

8 years ago

0.1.1

8 years ago

0.1.0

8 years ago