React Native MantineInputs

AngleSlider

Pick an angle value between 0 and 360 degrees

Import: import { AngleSlider } from 'react-native-mantine';

Usage

import { AngleSlider } from 'react-native-mantine';

<AngleSlider
  value={angle}
  onChange={setAngle}
  onChangeEnd={(value) => console.log(value)}
  size={100}
/>

// Snap to marks
<AngleSlider
  defaultValue={90}
  marks={[
    { value: 0 },
    { value: 90 },
    { value: 180 },
    { value: 270 },
  ]}
  restrictToMarks
/>

Props

PropTypeDefaultDescription
valuenumberControlled value in degrees, 0-359
defaultValuenumberDefault value for uncontrolled component
onChange(value: number) => voidCalled on value change
onChangeEnd(value: number) => voidCalled after the dragging is finished
sizenumber60Slider diameter in px
thumbSizenumberThumb diameter in px, calculated based on size by default
stepnumber1Step between values in degrees
withLabelbooleantrueDetermines whether the label should be displayed inside the slider
formatLabel(value: number) => React.ReactNodeFormats label based on the value
marks{ value: number; label?: string }[]Marks displayed on the slider
restrictToMarksbooleanfalseIf set, the value is always snapped to the closest mark
colorMantineColortheme.primaryColorKey of theme.colors or any valid color, controls thumb and marks color
disabledbooleanfalseIf set, the slider is disabled
labelStyleTextStyleLabel text style
styleViewStyleAdditional styles to apply to the root element

Source on GitHub · npm