feat(range): add classes and expose parts to allow individual styling of dual knobs#30941
Open
brandyscarney wants to merge 26 commits intofeature-8.8from
Open
feat(range): add classes and expose parts to allow individual styling of dual knobs#30941brandyscarney wants to merge 26 commits intofeature-8.8from
brandyscarney wants to merge 26 commits intofeature-8.8from
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
brandyscarney
commented
Jan 29, 2026
Member
Author
There was a problem hiding this comment.
This change is required otherwise it won't match knob when it has knob knob-a.
brandyscarney
commented
Jan 29, 2026
Member
Author
There was a problem hiding this comment.
I renamed the classes assigned to knob-handle from range-knob-a to range-knob-handle-a to match what they are actually applied to.
brandyscarney
commented
Jan 29, 2026
| configs({ directions: ['ltr'] }).forEach(({ title, screenshot, config }) => { | ||
| test.describe(title('range: customization'), () => { | ||
| test('should be customizable', async ({ page }) => { | ||
| await page.goto(`/src/components/range/test/custom`, config); |
Member
Author
There was a problem hiding this comment.
I removed the screenshots here in favor of checking that the styles are applied to the right element when the part is styled.
brandyscarney
commented
Feb 24, 2026
Comment on lines
+53
to
+56
| * @part activated - Added to the knob-handle, knob, and pin when the knob is activated (has the `ion-activated` class). Only one set has this part at a time when `dualKnobs` is `true`. | ||
| * @part focused - Added to the knob-handle, knob, and pin that currently has focus. Only one set has this part at a time when `dualKnobs` is `true`. | ||
| * @part hover - Added to the knob-handle, knob, and pin when the knob has hover. Only one set has this part at a time when `dualKnobs` is `true`. | ||
| * @part pressed - Added to the knob-handle, knob, and pin that is currently being pressed to drag. Only one set has this part at a time when `dualKnobs` is `true`. |
Member
Author
There was a problem hiding this comment.
In other components we add this as the part it works with like this:
* @part wheel-item active - The currently selected wheel-item.
* @part time-button active - The time picker button when the picker is open.but it seemed like a lot to add all of these:
Details
/**
* @part knob-handle - The container element that wraps the knob and handles drag interactions.
* @part knob-handle activated - The activated knob-handle. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle focused - The focused knob-handle. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle hover - The hovered knob-handle. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle pressed - The pressed knob-handle. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-handle-a - The container element for the first knob. Only available when `dualKnobs` is `true`.
* @part knob-handle-a activated - The activated knob-handle-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-a focused - The focused knob-handle-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-a hover - The hovered knob-handle-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-a pressed - The pressed knob-handle-a. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-handle-b - The container element for the second knob. Only available when `dualKnobs` is `true`.
* @part knob-handle-b activated - The activated knob-handle-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-b focused - The focused knob-handle-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-b hover - The hovered knob-handle-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-b pressed - The pressed knob-handle-b. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-handle-lower - The container element for the lower knob. Only available when `dualKnobs` is `true`.
* @part knob-handle-lower activated - The activated knob-handle-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-lower focused - The focused knob-handle-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-lower hover - The hovered knob-handle-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-lower pressed - The pressed knob-handle-lower. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-handle-upper - The container element for the upper knob. Only available when `dualKnobs` is `true`.
* @part knob-handle-upper activated - The activated knob-handle-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-upper focused - The focused knob-handle-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-upper hover - The hovered knob-handle-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-handle-upper pressed - The pressed knob-handle-upper. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part pin - The counter that appears above a knob.
* @part pin activated - The activated pin. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin focused - The focused pin. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin hover - The hovered pin. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin pressed - The pressed pin. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part pin-a - The counter that appears above the first knob. Only available when `dualKnobs` is `true`.
* @part pin-a activated - The activated pin-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-a focused - The focused pin-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-a hover - The hovered pin-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-a pressed - The pressed pin-a. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part pin-b - The counter that appears above the second knob. Only available when `dualKnobs` is `true`.
* @part pin-b activated - The activated pin-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-b focused - The focused pin-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-b hover - The hovered pin-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-b pressed - The pressed pin-b. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part pin-lower - The counter that appears above the lower knob. Only available when `dualKnobs` is `true`.
* @part pin-lower activated - The activated pin-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-lower focused - The focused pin-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-lower hover - The hovered pin-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-lower pressed - The pressed pin-lower. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part pin-upper - The counter that appears above the upper knob. Only available when `dualKnobs` is `true`.
* @part pin-upper activated - The activated pin-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-upper focused - The focused pin-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-upper hover - The hovered pin-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part pin-upper pressed - The pressed pin-upper. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob - The visual knob element that appears on the range track.
* @part knob activated - The activated knob. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob focused - The focused knob. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob hover - The hovered knob. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob pressed - The pressed knob. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-a - The visual knob element for the first knob. Only available when `dualKnobs` is `true`.
* @part knob-a activated - The activated knob-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-a focused - The focused knob-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-a hover - The hovered knob-a. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-a pressed - The pressed knob-a. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-b - The visual knob element for the second knob. Only available when `dualKnobs` is `true`.
* @part knob-b activated - The activated knob-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-b focused - The focused knob-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-b hover - The hovered knob-b. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-b pressed - The pressed knob-b. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-lower - The visual knob element for the lower knob. Only available when `dualKnobs` is `true`.
* @part knob-lower activated - The activated knob-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-lower focused - The focused knob-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-lower hover - The hovered knob-lower. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-lower pressed - The pressed knob-lower. Only one set has this part at a time when `dualKnobs` is `true`.
*
* @part knob-upper - The visual knob element for the upper knob. Only available when `dualKnobs` is `true`.
* @part knob-upper activated - The activated knob-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-upper focused - The focused knob-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-upper hover - The hovered knob-upper. Only one set has this part at a time when `dualKnobs` is `true`.
* @part knob-upper pressed - The pressed knob-upper. Only one set has this part at a time when `dualKnobs` is `true`.
*/
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Issue number: resolves #29862
What is the current behavior?
Range exposes a single part for both knobs & pins. This makes it impossible to style the knobs/pins differently when dual knobs is enabled.
What is the new behavior?
dualKnobsis enabled:range-dual-knobsrange-pressed-awhen the knob with name A is pressedrange-pressed-bwhen the knob with name B is pressedrange-pressed-lowerwhen the lower knob is pressedrange-pressed-upperwhen the upper knob is pressedknob-handle-a- The container element for the first knob. Only available whendualKnobsistrue.knob-handle-b- The container element for the second knob. Only available whendualKnobsistrue.knob-handle-lower- The container element for the lower knob. Only available whendualKnobsistrue.knob-handle-upper- The container element for the upper knob. Only available whendualKnobsistrue.pin-a- The counter that appears above the first knob. Only available whendualKnobsistrue.pin-b- The counter that appears above the second knob. Only available whendualKnobsistrue.pin-lower- The counter that appears above the lower knob. Only available whendualKnobsistrue.pin-upper- The counter that appears above the upper knob. Only available whendualKnobsistrue.knob-a- The visual knob element for the first knob. Only available whendualKnobsistrue.knob-b- The visual knob element for the second knob. Only available whendualKnobsistrue.knob-lower- The visual knob element for the lower knob. Only available whendualKnobsistrue.knob-upper- The visual knob element for the upper knob. Only available whendualKnobsistrue.pressed- Added to the knob-handle, knob, and pin that is currently being pressed to drag. Only one set has this part at a time.focused- Added to the knob-handle, knob, and pin that currently has focus. Only one set has this part at a time.hover- Added to the knob-handle, knob, and pin when the knob has hover. Only one set has this part at a time.activated- Added to the knob-handle, knob, and pin when the knob is activated. Only one set has this part at a time.Does this introduce a breaking change?
Other information
Dev build:
8.7.17-dev.11771865171.14f4c2cf