Range Slider

range slider

Range slider lets the user specify a numeric value that must be no less than a given value, and no more than another given value.

Usage

range slider

import SwiftUI

struct ExampleView: View {

    @State var valueLeft1:CGFloat = 20
    @State var valueRight1:CGFloat = 80

    var body: some View {
        XelaRangeSlider(
            valueLeft: $valueLeft1,
            valueRight: $valueRight1,
            range: 0...100,
            step: 1,
            primaryColor: Color(xelaColor: .Blue3),
            secondaryColor: Color(xelaColor: .Gray11)
        )
    }
}

Properties

Name Type Default Value Required Description
valueLeft Binding < CGFloat > - YES Binding Left value
valueRight Binding < CGFloat > - YES Binding Right value
range ClosedRange < CGFloat > - YES Slider range
step CGFloat 0.1 NO Step for slider
primaryColor Color Color(xelaColor: .Blue3) NO Primary - Accent color
secondaryColor Color Color(xelaColor: .Gray11) NO Secondary color
disabled Bool false NO Disable slider