Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Render custom component above thumb #605

Open
bryanltobing opened this issue Jun 9, 2024 · 0 comments
Open

Render custom component above thumb #605

bryanltobing opened this issue Jun 9, 2024 · 0 comments
Labels
question Further information is requested

Comments

@bryanltobing
Copy link

bryanltobing commented Jun 9, 2024

Ask your Question

i have requirement to render custom component with dynamic value above the thumb like this

image

I took a look at the code and there is no way for now to render custom component/element above the thumb.

maybe we can do something like this?

export const SliderTrackMark = ({
  isTrue,
  thumbImage,
  StepMarker,
+ index
+ renderAboveThumbComponent
}: TrackMarksProps) => {
  return (
    <View style={styles.trackMarkContainer}>
      {StepMarker ? <StepMarker stepMarked={isTrue} /> : null}
      {thumbImage && isTrue ? (
        <>
+           {renderAboveThumbComponent(index)}
            <View style={styles.thumbImageContainer}>
              <Image source={thumbImage} style={styles.thumbImage} />
            </View>
        </>
      ) : null}
    </View>
  );
};

API name inspired by https://github.com/miblanchard/react-native-slider/blob/cb80d87c7f80f27856613e18459c80c70d638df7/README.md?plain=1#L88

maybe one consideration, from windows example
there is already a box with step value rendered above the thumb.
image

is it gonna be a conflict if we implement this?
or is there a better way to handle this case?

@bryanltobing bryanltobing added the question Further information is requested label Jun 9, 2024
@BartoszKlonowski BartoszKlonowski added this to To be analyzed in Slider-Board via automation Jun 19, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
Slider-Board
  
To be analyzed
Development

No branches or pull requests

1 participant