Skip to content

knownasilya/ember-toggle

Folders and files

NameName
Last commit message
Last commit date

Latest commit

author
Ilya Radchenko
Oct 14, 2014
f4bd85b · Oct 14, 2014

History

25 Commits
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 10, 2014
Oct 13, 2014
Oct 10, 2014
Oct 14, 2014
Oct 14, 2014
Oct 10, 2014

Repository files navigation

ember-cli-toggle

Checkbox based Toggle Switch component for Ember.
Based on this codepen.

NPM

Usage

First install with npm install --save-dev ember-cli-toggle, and add one of the following in your template:

{{x-toggle toggle='startCar'}}
{{x-toggle theme='light' toggle='enableLayer'}}
{{x-toggle theme='ios' toggle='muteVolume'}}
{{x-toggle theme='flat' toggle='disableTest'}}
{{x-toggle theme='flip' off='Nope' on='Yep' toggle='haveFun'}}
{{x-toggle theme='skewed' toggle='enablePartyMode'}}

Configuring

Add a configuration for ember-cli-toggle to include only the themes that you will use.

ENV['ember-cli-toggle'] = {
  includedThemes: ['light', 'default', 'flip'],
  excludedThemes: ['flip'],
  defaultTheme: 'light' // defaults to 'default'
};

To exclude or not include a theme, means that it's css styles will not be bundled with your application, thus not polluting your app.

Note: Including a blank array e.g. includeThemes: [] will not include any themes, leaving you to define your own theme styles. See the vendor/ember-cli-toggle/themes directory for reference.

Contributing

Outlines how to begin contributing to this Ember-CLI project.

Installation

  • git clone this repository
  • npm install
  • bower install

Running

Running Tests

  • ember test
  • ember test --server

Building

  • ember build

For more information on using ember-cli, visit http://www.ember-cli.com/.