Isabella Bottini
Isabella Bottini

Reputation: 13

Problem displaying numbers with range slider in inIonic

I'm trying yo make a range slider in Ionic to set an age between 0 and 25 years old. I want to show the number options when selected, for example:

I'm 21 years old

When I slide I want to see the number 21 displayed. (see image please. Notice: it's in Portuguese) So far, my code works. But it doesn't display the numbers while I slide the ranger

<ion-item>
  <ion-range min="o" max="25" color="tertiary">
    <ion-label slot="start">0 ano</ion-label>
    <ion-label slot="end">25 anos</ion-label>
  </ion-range>
</ion-item>

I just want to display the number while I slide it so the user can select the correct option

Upvotes: 1

Views: 422

Answers (1)

AbdulAzeem
AbdulAzeem

Reputation: 529

add pin=true it will show the number while sliding

<ion-item>
<ion-range min="o" max="25" color="tertiary" pin="true">
  <ion-label slot="start">0 ano</ion-label>
  <ion-label slot="end">25 anos</ion-label>
</ion-range>
</ion-item>

Upvotes: 2

Related Questions