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

[Slider] Implement variant prop #27130

Open
david-ic3 opened this issue Jul 5, 2021 · 4 comments
Open

[Slider] Implement variant prop #27130

david-ic3 opened this issue Jul 5, 2021 · 4 comments
Labels
component: slider This is the name of the generic UI component, not the React module! new feature New feature or request

Comments

@david-ic3
Copy link

Material-UI : v5.0.0-beta.0 with Typescript

It's possible to add variants to Buttons as described in your documentation here.

Can't get this work with the Slider (compile error as variants is not a Slider prop).

Is this expected ?

@david-ic3 david-ic3 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Jul 5, 2021
@mnajdova
Copy link
Member

mnajdova commented Jul 7, 2021

The Slider component does not support the variant prop. This makes me think of a discussion we had when adding the theme.variants for allowing developers to extend the props.

Regarding the Slider, you may extend the color or size property. Can you please share what is the use-case you have in mind?

@mnajdova mnajdova added component: slider This is the name of the generic UI component, not the React module! and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jul 7, 2021
@david-ic3
Copy link
Author

To have an overview of our application. It's dashboard editor, same concept as invision or photoshop. So we have a theme for the editor and one for the content (dashboard). We already have two different Themes with their variants but a single Theme type mapping. On top of that users can add new themes with their own variants dynamically.

We allow users to define variants for each of our components (some of them are MUI ones). We are using MUI Theme. Somehow we want to be able to extend Slider the same way we can do with Buttons. Defining for example the pretto.fr customization as a variant ( https://next.material-ui.com/components/slider/#customized-sliders ).

At run time we get the list of variants for each component.

Does it makes sense to have different slider variants in an 'application' ? I would say no, but eventually customers will decide if they want or not to use this flexibility.

It's a problem of consistency , nothing really important for us as what we are doing now is styling ( using styled ) Slider's parent div to allow variants (we could style directly Slider as well).

   const StyledSlider = styled('div',  ....

@eps1lon eps1lon added the new feature New feature or request label Jul 20, 2021
@eps1lon eps1lon changed the title Slider missing variant prop [Slider] Implement variant prop Jul 20, 2021
@paales
Copy link
Contributor

paales commented Jan 6, 2022

@mnajdova Due to this line https://github.com/mui-org/material-ui/blob/v5.2.7/packages/mui-material/src/Slider/Slider.js#L657 it seems it isn't possible to actually possible to create a new size size

@mnajdova
Copy link
Member

@paales looks like it wasn't updated as it is done with the other components, for example, the Button We also need to update the types for the props. Would you like to create a PR for this?

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! new feature New feature or request
Projects
None yet
Development

No branches or pull requests

4 participants