1.1.5 • Published 6 months ago

react-step-slider v1.1.5

Weekly downloads
-
License
MIT
Repository
github
Last release
6 months ago

React Step Slider

ReactStepSlider is a step-based slider component that allows users to navigate through steps with customizable styling.

Installation

Install the package using npm or yarn

npm install react-step-slider
yarn add react-step-slider

Usage

import { ReactStepSlider } from "react-step-slider";

function App() {
  const handleStepChange = (value: number) => {
    console.log("Current step:", value);
  };

  return (
    <ReactStepSlider
      steps={8}
      onChange={() => {}}
      dotColor={"red"}
      dotSize={12}
      verticalLineColor="#0F0F"
      verticalLineHeight={25}
      verticalLineWidth={3}
      horizontalLineHeight={3}
      horizontalLineColor="#C0FF"
      labels={[
        "first label",
        "second label hello world",
        "third label",
        "fourth label",
        "fifth label",
      ]}
      labelSize={16}
      ellipsisLabelWidth={110}
    />
  );
}

export default App;

Props

PropTypeDefaultDescription
stepsstring5Number of steps in the slider
onChange(value: number) => void2RequiredCallback function triggered on step change
dotColorstring#0000FFColor of the moving dot
verticalLineColorstring#0000FFColor of the vertical lines
verticalLineHeightstring16pxHeight of the vertical lines
verticalLineWidthnumber3Width of the vertical lines
horizontalLineHeightstring2pxHeight of the horizontal line
horizontalLineColorstring#0000FFColor of the horizontal line
labelsArray[]Array of labels for each step
labelSizenumber16Font Size of label text
ellipsisLabelWidthnumber20Width of label

Custom Styling

<ReactStepSlider
  steps={8}
  onChange={() => {}}
  dotColor={"red"}
  dotSize={12}
  verticalLineColor="#0F0F"
  verticalLineHeight={25}
  verticalLineWidth={3}
  horizontalLineHeight={3}
  horizontalLineColor="#C0FF"
  labels={[
    "first label",
    "second label hello world",
    "third label",
    "fourth label",
    "fifth label",
  ]}
  labelSize={16}
  ellipsisLabelWidth={110}
/>

License

MIT © crayonzgrim

1.1.5

6 months ago

1.1.4

6 months ago

1.1.3

6 months ago

1.1.2

6 months ago

1.1.1

6 months ago

1.1.0

6 months ago

1.0.1

7 months ago

1.0.0

7 months ago