Skip to content

volldigital/ember-cli-nouislider

 
 

Repository files navigation

@voll/ember-cli-nouislider (fork of ember-cli-nouislider)

This ember-cli addon provides you with a range-slider component, based on noUiSlider. It includes everything you need, and adds no extra dependencies other than noUiSlider itself (which has no external dependencies).

To get started simply install the addon:

$ ember install @voll/ember-cli-nouislider

This will install nouislider via Bower, and will include it into your application's mergetree, so you don't need to worry about anything there.

Compatibility

  • Ember.js v3.12 or above
  • Ember CLI v2.13 or above
  • Node.js v10 or above

Component

You have the opportunity to customize if needed.

To do this, generate your own component and re-export the one provided:

$ ember g component range-slider
// app/components/range-slider.js
import RangeSlider from '@voll/ember-cli-nouislider/components/range-slider';

export default RangeSlider;

Include the slider into your views like this:

{{range-slider start=someValue on-change=(action "changedAction")}}

And setup an action handler in your route:

// app/routes/my-route.js
import Controller from '@ember/controller';
import { debug } from '@ember/debug';

export default Controller.extend({
  // ...
  actions: {
    // ...
    changedAction: function(value) {
      debug( `New slider value: ${value}`);
    }
  }
});

Configuration

The component has a lot of configurable options, most of them mapping directly to the original options. To see how the slider is initialized internally, please have a look at app/components/range-slider.js in this project.

License

This project is licensed under the MIT License.

About

{{range-slider}} component for ember-cli powered by noUiSlider

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Handlebars 42.8%
  • JavaScript 34.4%
  • SCSS 18.1%
  • HTML 3.6%
  • Shell 1.1%