English 中文(简体)
Ionic - Range
  • 时间:2024-09-08

Ionic - Range


Previous Page Next Page  

Ionic range is used to choose and display the level of something. It will represent the actual value in co-relation to maximal and minimal value. Ionic offers a simple way of working with Range.

Using Range

Range is used as an inside item element. The class that is used is range. We will place this class after the item class. This will prepare a container where the range will be placed. After creating a container, we need to add input and assign the range type to it and the name attribute as well.

<span class = "item range">
   <input type = "range" name = "range1">
</span>

The above code will produce the following screen −

Ionic Range

Adding Icons

Range will usually require icons to display the data clearly. We just need to add icons before and after the range input to place them on both sides of the range element.

<span class = "item range">
   <i class = "icon ion-volume-low"></i>
   <input type = "range" name = "volume">
   <i class = "icon ion-volume-high"></i>
</span>

The above code will produce the following screen −

Ionic Range Icons

Stypng Range

Our next example will show you how to style Range with Ionic colors. The color classes will use a range prefix. We will create a pst with nine ranges and style it differently.

<span class = "pst">
   <span class = "item range range-pght">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-stable">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-positive">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-calm">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-balanced">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-energized">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-assertive">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-royal">
      <input type = "range" name = "volume">
   </span>
	
   <span class = "item range range-dark">
      <input type = "range" name = "volume">
   </span>
</span>

The above code will produce the following screen −

Ionic Range Color Advertisements