Hacktoberfest 2026: the issues maintainers tagged for October, open and beginner-friendly. Browse Hacktoberfest issues

Alternative for trackStyle and handleStyle

Open
#1,056 0 comments 1 reaction 0 assignees View on GitHub

Nobody has claimed this yet.

Assessment

Difficulty
4/5
Estimated time
3-5 days
Newbie friendliness
35/100
Issue type
Feature
Clarity
Mostly clear
Activity status
Stale
Tech stack
react, typescript
Domain
frontend

Research direction

Start by reviewing the Slider API and the type definition for styles.track and styles.handle, then compare them with the deprecated trackStyle and handleStyle props shown in the issue. Determine whether multiple per-track and per-handle values are supported or require an API change; done means the use case has a documented, working approach or a clearly specified replacement.

Written by the indexing model from the issue text.

Description

I have a usecase like this where I want to provide different color and styling to different tracks and handles so I used trackStyle and handleStyle as array

 <Slider
        value={values}
        step={1}
        range={{ maxCount: 4 }}
        allowCross={false}
        marks={marks}
        dots={false}
        trackStyle={[
          { backgroundColor: "green", height: height },
          { backgroundColor: "yellow", height: height },
          { backgroundColor: "red", height: height },
        ]}
        onChange={handleChange}
        handleStyle={[
          { display: "none" },
          handleStyle,
          handleStyle,
          { display: "none" },
        ]}
        railStyle={{ height: height }}
        handleRender={handleRender}
        activeDotStyle={{ display: "none" }}
      />

But now both these properties are deprecated, and we have to use styles.track or styles.handle for this but I'm not able to identify how to provide multiple values in styles.track since it takes a simple object.
Partial<Record<SemanticName, React.CSSProperties>>;

Can we do something in this case?

Dominant language
TypeScript
Stars
3.1k
Forks
767
Avg merge
11m
Merged PRs (30d)
1

Getting set up

This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

More from react-component/slider

All issues in react-component/slider

Similar issues

More TypeScript issues

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.