Skip to main content

Slider

Slider is a simple slider with option to select with range.

How to use

import React from 'react';
import {Slider} from '@gyri/native-ui-components';

const MyComponent = () => {
const [lowValue, setLowValue] = React.useState(18);

return (
<Slider
disableRange={true}
min={18}
max={99}
lowValue={lowValue}
step={1}
thumbSize={36}
thumbColor={'#fff'}
activeColor={'#FE6600'}
updateValue={setLowValue}
railHeight={5}
/>
);
};

export default MyComponent;

Props

#NameData typeDefault valueValuesDescription
1updateValuefunctionconsole.logUpdate low and high value callback. If disableRange is true then only update lowValue
2disableRangebooltrueSlider with range.
3minnumber0Min value of slider.
4maxnumber100Max value of slider.
5stepnumber1Step for slider.
6lowValuenumberLower side value of slider. if disableRange is true, then this value is used.
7highValuenumberHigher value for slider.
8thumbSizenumber16Thumb (knob) size for slider.
9thumbColorstring'#FE6600'Thumb color.
10activeColorstring'#FE6600'Active color for rail.
11railBgColorstring'#E4E4E4'Rail background color.
12railHeightstring4Height for rail.
13styleobjectCustom style object
14classNamestring''It defined nativewind style classes.

For more details https://github.com/githuboftigran/rn-range-slider