user2662006
user2662006

Reputation: 2294

ionic 2 how to customize ion-range?

in ionic 2, I want to customize the ion-range to be something like the following pic, or I should say : is there way to customize ion-range ?: enter image description here

here is my code

    <ion-row>
      <ion-item>
         <ion-range min="500" max="1500" step="500" snaps="true" color="secondary"></ion-range>
      </ion-item>
    </ion-row>

and here is my range

enter image description here

Upvotes: 3

Views: 5799

Answers (1)

user2662006
user2662006

Reputation: 2294

I did find out how to customize "ion-range", and here is what I built (I know it look not exact):

enter image description here

here are my steps:- 1- add these line of codes shown on picture to your src\theme\variables.scss enter image description here

Note: there is many variables you can use to customize your ion-range in the folowing link ionic2 docs

2- here is my component code:

<ion-footer>
  <ion-toolbar>
    <ion-row>
      <ion-col width-33 text-left>
        Sedan
      </ion-col>
      <ion-col width-33 text-center>
        SUV
      </ion-col>
      <ion-col width-33 text-right>
        LUX
      </ion-col>
    </ion-row>
    <ion-range (ionChange)="selectCar()" min="500" max="1500" step="500" snaps="true" [(ngModel)]="value">
    </ion-range>

  </ion-toolbar>
 </ion-footer>

Upvotes: 5

Related Questions