feat(slider): add markerLabel to anatomy #10531
Open
+15
−2
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Closes #10514
Description
Added
markerLabelto thesliderAnatomyand updated the Slider component to use<chakra.span>for the marker label. This allows the label to be styled via the theme system.Current behavior (updates)
Currently, the slider marker label is a plain HTML
<span>with a hardcoded class name (chakra-slider__marker-label). Because it is not part of the component anatomy or a chakra element, it ignores theme styles and cannot be customized via the theme config.New behavior
markerLabelto thesliderAnatomydefinition.Slidercomponent to render the label as a<chakra.span>instead of a plain<span>.__css={styles.markerLabel}.This allows users to style the marker label (e.g., adding
textOverflow, changing colors, or adjusting font size) directly through the theme.Is this a breaking change (Yes/No):
No
Additional Information
Verified the changes in Storybook using the "With Marks" story. The existing class name
chakra-slider__marker-labelwas preserved for backward compatibility.