# Multiple Range Input Request

**URL:** <https://forum.ionicframework.com/t/multiple-range-input-request/757>\
**Category:** ionic-v1\
**Created:** [February 2, 2014, 2:35am UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757 "2014-02-02T02:35:27Z")\
**Posts on this page:** 14\
**Page:** 1

<div class="post-metadata">

**Author:** ![seanhill](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/seanhill/32/105765_2.png) [@seanhill](https://forum.ionicframework.com/u/seanhill)\
**Post date:** [February 2, 2014, 2:35am UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/1 "2014-02-02T02:35:27Z")

</div>

Hi there,

I was wondering if there was a way to use the range input with two sliding buttons. For instance my min would be 1 and my max 100 and I wanted to chose the range 30-50. This would be excellent if I could somehow extend the range input or if this was built in. Thanks!

---

<div class="post-metadata">

**Author:** ![tim](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tim/32/7550_2.png) [@tim](https://forum.ionicframework.com/u/tim)\
**Post date:** [February 3, 2014, 6:20pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/2 "2014-02-03T18:20:47Z")

</div>

The short answer is: nope.

At this time, the Ionic range input is just a styled HTML range input, which doesn’t support multiple sliders.

However, I’ve opened a feature request on Github for this: [https://github.com/driftyco/ionic/issues/512](https://github.com/driftyco/ionic/issues/512).

---

<div class="post-metadata">

**Author:** ![hakan\_ebabil](https://avatars.discourse-cdn.com/v4/letter/h/a88e57/32.png) [@hakan\_ebabil](https://forum.ionicframework.com/u/hakan_ebabil)\
**Post date:** [July 16, 2014, 2:14pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/3 "2014-07-16T14:14:35Z")

</div>

Hi !

It would really be nice to have this component in Ionic. We need this to create a price range with min and max values…

---

<div class="post-metadata">

**Author:** ![thechrisroberts](https://avatars.discourse-cdn.com/v4/letter/t/858c86/32.png) [@thechrisroberts](https://forum.ionicframework.com/u/thechrisroberts)\
**Post date:** [July 16, 2014, 2:29pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/4 "2014-07-16T14:29:57Z")

</div>

I had the same need and same request but I came across [http://prajwalkman.github.io/angular-slider/](http://prajwalkman.github.io/angular-slider/) and it works quite nicely. The slider can be styled, it allows two values, and it does not require jQuery. Works well in my project.

---

<div class="post-metadata">

**Author:** ![leanzubrezki](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/leanzubrezki/32/66167_2.png) [@leanzubrezki](https://forum.ionicframework.com/u/leanzubrezki)\
**Post date:** [October 9, 2014, 3:15pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/5 "2014-10-09T15:15:15Z")

</div>

I am having troubles getting it work, you are using it?, now is DEPRECATED.  
I have problems in the style, anyone have a working example?

---

<div class="post-metadata">

**Author:** ![tannerlinsley](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/tannerlinsley/32/76522_2.png) [@tannerlinsley](https://forum.ionicframework.com/u/tannerlinsley)\
**Post date:** [January 30, 2016, 11:56pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/6 "2016-01-30T23:56:40Z")

</div>

Hey all, I’ve got a nice implementation that looks like it should be included in the kit. The api is a bit different, but the visuals are close to perfect.

Default Ionic Slider and dual slider for comparison:

 ![image](https://global.discourse-cdn.com/ionicframework/original/3X/9/2/92a4e3565796a0175697a955d2675a439da80217.png)

Slider framework: [nouislider](https://github.com/leongersen/noUiSlider) + [nouislider-angular](https://github.com/Yankovsky/nouislider-angular)

Markup:

```auto
<ion-item class="has-nouislider">
        <i class="icon ion-android-favorite-outline"></i>
        <div ya-no-ui-slider="vm.options"></div>
        <i class="icon ion-android-favorite"></i>
      </ion-item>

```

CSS (Stylus):

```auto
.item.has-nouislider
  display:flex
  padding-left: 11px
  padding-right: 11px

  i
    display: block
    min-width: 24px
    text-align: center
    font-size: 24px
    text-align:center

  [ya-no-ui-slider]
    flex: 1
    height:24px
    margin-left:10px
    margin-right:10px
    border-radius:0
    border:0
    box-shadow:none
    background-color: transparent

    .noUi-base
      margin-left: 17px
      margin-right: 13px
      width: auto

    .noUi-origin:first-child
      &:before
        content: ''
        background: $colorPrimary
        position:absolute
        width:100%
        height:2px
        top:50%
        transform: translateY(-50%)

    .noUi-origin:last-child
      &:before
        content: ''
        background: lightness(black, 80%)
        position:absolute
        width:100%
        height:2px
        top:50%
        transform: translateY(-50%)

    .noUi-handle
      top: -3px
      height: 29px
      width: 29px
      border-radius: 100%
      border: 0
      background: white
      box-shadow: 0 0 2px 0 alpha(black .3), 0 2px 5px 0 alpha(black .2)

      &:after, &:before
        display:none

    &:before
      content: ''
      background: lightness(black, 80%)
      position:absolute
      width:100%
      height:2px
      top:50%
      transform: translateY(-50%)

  &.light [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorLight
  &.stable [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorStable
  &.positive [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorPositive
  &.calm [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorCalm
  &.balanced [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorBalanced
  &.energized [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorEnergized
  &.assertive [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorAssertive
  &.royal [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorRoyal
  &.dark [ya-no-ui-slider] .noUi-origin:first-child:before
    background-color: $colorDark

```

You’ll probably need to change the styling a bit if you don’t want to use icons. But this should get you most of the way there.

---

<div class="post-metadata">

**Author:** ![shaoner](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@shaoner](https://forum.ionicframework.com/u/shaoner)\
**Post date:** [April 15, 2016, 5:13pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/7 "2016-04-15T17:13:06Z")

</div>

Here is a simple ionic solution: [http://codepen.io/shaoner/pen/ZWoYgE](http://codepen.io/shaoner/pen/ZWoYgE)

---

<div class="post-metadata">

**Author:** ![nales](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nales/32/100268_2.png) [@nales](https://forum.ionicframework.com/u/nales)\
**Post date:** [May 4, 2016, 1:13pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/8 "2016-05-04T13:13:06Z")

</div>

I used your codepen link. Now my question is how do I get value of ‘from’ and ‘to’ changed by user? Which callback should I use?

---

<div class="post-metadata">

**Author:** ![shaoner](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@shaoner](https://forum.ionicframework.com/u/shaoner)\
**Post date:** [May 4, 2016, 2:20pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/9 "2016-05-04T14:20:42Z")

</div>

@nales, I’ve updated it using an object as reference (usually I use vm instead of $scope anyway)

---

<div class="post-metadata">

**Author:** ![nales](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nales/32/100268_2.png) [@nales](https://forum.ionicframework.com/u/nales)\
**Post date:** [May 4, 2016, 2:24pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/10 "2016-05-04T14:24:40Z")

</div>

Yes. That’s fine. But how can I call API when these values change? For example for sample range I use ng-change=‘update()’ function and then in controller define update function. Here only value changes in UI how do I get change event in main controller?

I tried using $scope,$watch for ‘from’ and ‘to’ variables.

Btw thanks you for this code pen.

---

<div class="post-metadata">

**Author:** ![shaoner](https://avatars.discourse-cdn.com/v4/letter/s/2bfe46/32.png) [@shaoner](https://forum.ionicframework.com/u/shaoner)\
**Post date:** [May 4, 2016, 2:42pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/11 "2016-05-04T14:42:36Z")

</div>

@nales, Take a look at ng-change-min and ng-change-max attributes, you can pass one or two different callbacks

---

<div class="post-metadata">

**Author:** ![nales](https://sea1.discourse-cdn.com/ionicframework/user_avatar/forum.ionicframework.com/nales/32/100268_2.png) [@nales](https://forum.ionicframework.com/u/nales)\
**Post date:** [May 4, 2016, 3:26pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/12 "2016-05-04T15:26:39Z")

</div>

Tried this.

ui-multi-range(ng-step=‘1’, ng-min=18, ng-max=50, ng-model-min=‘agefrom’, ng-model-max=‘ageto’ ng-change-max=‘update()’ ng-change-min=‘update()’)

Not working. Do I need to change in directive?

---

<div class="post-metadata">

**Author:** ![nmckeown](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@nmckeown](https://forum.ionicframework.com/u/nmckeown)\
**Post date:** [January 11, 2017, 7:23pm UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/13 "2017-01-11T19:23:37Z")

</div>

Looks great, is it possible for you to paste your css again. The above seems to be missing some formatting. Thanks.

---

<div class="post-metadata">

**Author:** ![nmckeown](https://avatars.discourse-cdn.com/v4/letter/n/ecc23a/32.png) [@nmckeown](https://forum.ionicframework.com/u/nmckeown)\
**Post date:** [October 1, 2017, 11:53am UTC](https://forum.ionicframework.com/t/multiple-range-input-request/757/14 "2017-10-01T11:53:19Z")

</div>

This worked really well for me 🙂

> **[Yankovsky/nouislider-angular](https://github.com/Yankovsky/nouislider-angular)**
>
> nouislider-angular - angular wrapper for nouislider

Example of my html:

```auto
<ion-list>
	<ion-item class="has-nouislider">
		18&nbsp;&nbsp;<div ya-no-ui-slider="desc.ageSliderOptions"
						  ya-no-ui-slider-events="desc.ageSliderEvents"></div>&nbsp;&nbsp;65+
	</ion-item>
</ion-list>

```
