Slider Input


Sliders allow users to make selections from minimum and maximum values. Slider input allows for easy adjustments of a value and checks the updated result immediately.



import SwiftUI

struct ExampleView: View {
    @State var sliderValue:CGFloat = 60

    var body: some View {
        XelaSlider(value: $sliderValue, range: 0...100, step: 1, vertical: false, primaryColor: Color(xelaColor: .Green2))


Name Type Default Value Required Description
value Binding < CGFloat > - YES Binding slider value
range ClosedRange < CGFloat > - YES Slider range
step CGFloat 0.1 NO Slider step
vertical Bool false NO Slider change orientation to vertical
primaryColor Color Color(xelaColor: .Blue3) NO Slider primary - accent color
secondaryColor Color Color(xelaColor: .Gray11) NO Slider secondary color
disabled Bool false NO Disable slider