1.0.5 • Published 3 years ago

fast-circular-slider v1.0.5

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

FAST circular slider

Introduction

Circular slider with start and end handle designed for the FAST project.

Installation

You can install fast-circular-slider via Yarn or npm:

# If using Yarn:
yarn add fast-circular-slider

# If using npm:
npm install --save fast-circular-slider

The core component from fast-circular-slider is CircularSlider. This module can be required via ES imports or CommonJS require.

import CircularSlider from 'fast-circular-slider';

// using require
const CircularSlider = require('fast-circular-slider');

Usage

import React, { useState } from 'react'
import { render } from 'react-dom'
import CircularSlider from 'fast-circular-slider'

const [value, setValue] = useState<[number, number]>([320, 40])

const handleChange = (value : [number, number]) => {
  setValue(value)
}

render(
  <CircularSlider
      value={value}
      onChange={handleChange}
  />, document.getElementById('root'))

PROPS & METHODS

Prop nameTypeDefaultDescription
valuenumber, number320, 40The value of the slider
onChange(value) => voidnullCallback function that is fired when the user changes the slider's value
disabledbooleanfalseIf true, the slider will not be interactable
circleRadiusnumber67Radius of the circle
circleWidthnumber4Stroke width of the circle
circleColorstring'#dedede'Color of the circle
handleRadiusnumber6Radius of the handle
handleWidthnumber2Stroke width of the handle
arcWidthnumber4Stroke width of the arc
sliderColorstring#91d5ffColor of the slider when enabled
disabledColorstring#b8b8b8Color of the slider when disabled
hoverColorstring#69c0ffColor of the slider on hover
focusColorstring#69c0ffColor when the degree input field is in focus
shipbooleanfalseIf true, ship outline will be shown

License

MIT

1.0.5

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago