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

[Joy] Add Slider component and demos #32694

Merged
merged 41 commits into from Jun 5, 2022
Merged

Conversation

hbjORbj
Copy link
Member

@hbjORbj hbjORbj commented May 9, 2022

Done:

  • Initial implementation
  • Apply Joy theme (color, variant, size)
  • Examples with some varying prop values
  • tests (need more)
  • examples
  • demos

Docs: https://deploy-preview-32694--material-ui.netlify.app/joy-ui/react-slider/

@hbjORbj hbjORbj changed the title [Joy] Add Slider component [Joy] Add Slider component May 9, 2022
@hbjORbj hbjORbj added component: slider This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy labels May 9, 2022
@mui-bot
Copy link

mui-bot commented May 9, 2022

Details of bundle changes

@mui/joy: parsed: +12.85% , gzip: +13.55%

Generated by 🚫 dangerJS against 37bded4

@siriwatknp
Copy link
Member

About the global variants, let's follow the Switch component. However, the Slider is a bit more complex because it has rail element.

Screen Shot 2565-05-10 at 09 43 36

For the component variables, here is what I think (quite similar to Switch):

--Slider-track-height
--Slider-track-radius
--Slider-rail-height
--Slider-thumb-size
--Slider-thumb-shadow

It's better to do the customization with different design eg. https://mui.com/material-ui/react-slider/#customization to see if the variables make sense, what are missing or too complicated.

@github-actions github-actions bot added the PR: out-of-date The pull request has merge conflicts and can't be merged label May 18, 2022
@github-actions github-actions bot removed the PR: out-of-date The pull request has merge conflicts and can't be merged label May 18, 2022
@siriwatknp
Copy link
Member

siriwatknp commented May 31, 2022

Props

variant

Sorry about this Benny, I think let's remove the variant prop and go with one default design for the Slider. I feel that the slider is an exception for the global variants. Let's use this one as a default design:

Screen Shot 2565-05-31 at 10 37 54

The color prop still exists. You can use this token for the default design:

'--Slider-track-background': theme.vars.palette[color!]?.solidBg

Demos

Can you add the functionality demos similar to Material UI?

  • steps
  • marks
  • label
  • range
  • removed track, inverted track

@hbjORbj hbjORbj changed the title [Joy] Add Slider component [Joy] Add Slider component and demos Jun 2, 2022
Copy link
Member

@siriwatknp siriwatknp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍 I pushed some improvements about the variables to make it works with vertical slider and combine the colors & sizes into one demo

@siriwatknp siriwatknp merged commit 0ad2ed1 into mui:master Jun 5, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: slider This is the name of the generic UI component, not the React module! package: joy-ui Specific to @mui/joy
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants