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

[DateTimePicker] Can't change the color for the tabs #11532

Closed
sanjitchh opened this issue Dec 30, 2023 · 8 comments · Fixed by #12096
Closed

[DateTimePicker] Can't change the color for the tabs #11532

sanjitchh opened this issue Dec 30, 2023 · 8 comments · Fixed by #12096
Assignees
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature

Comments

@sanjitchh
Copy link

sanjitchh commented Dec 30, 2023

Related page

https://mui.com/x/react-date-pickers/custom-components/

Kind of issue

Missing information

Issue description

I wanted to change the color for the Date Time Picker tabs that let us switch between the date and the time sections of the picker. There is no clear explainantion for how to to it. I cannot add sx to the tabs in the slotprops and adding the class somewhere else is also not working.

Context 🔦

No response

Search keywords: DateTimePicker tab color

@sanjitchh sanjitchh added status: waiting for maintainer These issues haven't been looked at yet by a maintainer support: docs-feedback Feedback from documentation page labels Dec 30, 2023
@zannager zannager added the component: pickers This is the name of the generic UI component, not the React module! label Jan 1, 2024
@LukasTy
Copy link
Member

LukasTy commented Jan 2, 2024

Thank you for reporting this problem! 🙏
I can confirm that there is an issue here, at a minimum this component should support className and sx prop.
The classes prop is technically optional because it only contains a root slot.
At the same time, we should add the missing classes prop to the DateTimePickerToolbar.

@LukasTy LukasTy added enhancement This is not a bug, nor a new feature and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Jan 2, 2024
@LukasTy LukasTy changed the title Can't change the color for the tabs bor the Date Time Picker [DateTimePicker] Can't change the color for the tabs Jan 2, 2024
@iamabhshk
Copy link

Can I look into this? @LukasTy

@LukasTy
Copy link
Member

LukasTy commented Jan 3, 2024

Can I look into this?

Feel free to work on it. 👍
Just to let you know, we have not groomed this issue yet, thus, the information might not be complete. 🤔

@iamabhshk
Copy link

I analyzed the code and here's what I found.
MUIX-1

In the above screenshot, we are using a 'ToggleButtonGroup' component and it has a color property. In order to change the color we can replace the 'primary' with these options: ['secondary'| 'error' | 'info'| 'success'| 'warning']
For details you can refer to this link https://mui.com/material-ui/api/toggle-button-group/

I hope this is what you were seeking if my understanding to your issue was correct.

@LukasTy
Copy link
Member

LukasTy commented Jan 4, 2024

@iamabhshk If we are talking about building your own "DatePicker" various subcomponents - then sure, your example makes sense, but in this case the problem is different.
The issue author is expecting the ability to provide styling props to the DateTimePickerTabs component. 😉

@sanjitchh
Copy link
Author

@LukasTy @iamabhshk Hey! Sorry for not providing more context. I was talking about the color of the tabs of the DateTimePicker component that we get when we have tabs: {hidden: false} in the slotProps. I was looking to customize the the tab colors separately using sx as i have done for day but the tabs slotProp currently does not support sx.
I have attatched the image of my code and the tabs I am talking about.

image
image

@iamabhshk
Copy link

Ohh I see, now I am clear. Let me try it and will let you know.

Copy link

⚠️ This issue has been closed.
If you have a similar problem, please open a new issue and provide details about your specific problem.
If you can provide additional information related to this topic that could help future readers, please feel free to leave a comment.

How did we do @sanjitchh?
Your experience with our support team matters to us. If you have a moment, please share your thoughts through our brief survey.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pickers This is the name of the generic UI component, not the React module! enhancement This is not a bug, nor a new feature
Projects
None yet
Development

Successfully merging a pull request may close this issue.

5 participants