@fseehawer/react-circular-slider
Version:
A customizable circular slider with no dependencies.
63 lines (60 loc) • 1.77 kB
TypeScript
import React from 'react';
declare const knobOffsetConsts: {
readonly top: number;
readonly right: 0;
readonly bottom: number;
readonly left: number;
};
type KnobPosition = keyof typeof knobOffsetConsts | number | string;
type GradientStop = {
offset?: string;
stopColor: string;
stopOpacity?: number;
};
interface CircularSliderProps {
label?: string;
width?: number;
direction?: 1 | -1;
min?: number;
max?: number;
initialValue?: number;
value?: number;
knobColor?: string;
knobSize?: number;
knobPosition?: KnobPosition;
labelColor?: string;
labelBottom?: boolean;
labelFontSize?: string;
valueFontSize?: string;
appendToValue?: string;
prependToValue?: string;
verticalOffset?: string;
hideLabelValue?: boolean;
hideKnob?: boolean;
hideKnobRing?: boolean;
knobDraggable?: boolean;
progressColorFrom?: string;
progressColorTo?: string;
progressGradient?: (string | GradientStop)[];
useMouseAdditionalToTouch?: boolean;
progressSize?: number;
trackColor?: string;
trackGradient?: (string | GradientStop)[];
trackSize?: number;
trackDraggable?: boolean;
data?: (string | number)[];
dataIndex?: number;
progressLineCap?: 'round' | 'butt';
renderLabelValue?: React.ReactNode;
onChange?: (value: string | number) => void;
isDragging?: (dragging: boolean) => void;
children?: React.ReactNode;
limitDragRange?: boolean;
arcStart?: number;
arcEnd?: number;
}
interface CircularSliderHandle {
refresh: () => void;
}
declare const CircularSlider: React.ForwardRefExoticComponent<CircularSliderProps & React.RefAttributes<CircularSliderHandle>>;
export { CircularSlider as default };