mui-x
mui-x copied to clipboard
[pickers][DatePicker] change borderRadius of selected day for dateCalendar
Steps to reproduce
No response
Current behavior
No response
Expected behavior
No response
Context
Hi, I am trying to change the borderRadius for the days which are been selected or like the todays day, but not working for me
<DateCalendar
{...props}
slots={{
leftArrowIcon: LeftArrowIcon,
rightArrowIcon: RightArrowIcon,
}}
slotProps={{
day: {
sx: {
"::selection": {
borderRadius: "10px",
},
},
},
}}
/>
Your environment
No response
Search keywords: .
@ImamJanjua is this something that you are looking for? π€ Consider checking the customization playground for more examples. π
@LukasTy thanks man!
another thing, calendar is not responsive at all and appears to have fixed dimension, does it have something to do with the breakpoints?
https://github.com/mui/mui-x/assets/137432044/1f2a7427-2dbd-41d4-9922-89c4b1892d58
another thing, calendar is not responsive at all and appears to have fixed dimension, does it have something to do with the breakpoints?
Yes, the calendar has a fixed width just as the material design suggests. Do you have suggestions on how to make it responsive? π€
@LukasTy shouldn't u know that? π
shouldn't u know that? π
Well, that's basically an answerβwe don't know of a good way to make the calendar UX friendly and responsive, that's why it has the same fixed width as the material design suggests. It's enough to fit in the portrait orientation of all the modern smallest mobile devices, so, it seems to do the trick. π€
@LukasTy does the calendar has breakpoints and can i acess and modify them?
does the calendar has breakpoints and can i acess and modify them?
No, there are no explicit breakpoints that are used. If you want to use the theme breakpoints, then access them and override the styles accordingly. π
@LukasTy thanks!
do u may know how can change the view with custom header?
const DateCalendar: React.FC<DateCalendarProps<Date>> = (props) => {
const Header = () => {
return (
<div className="flex flex-row justify-center gap-8 ">
{/* on press go to next month*/}
<button>
<ChevronLeft size={22} />
</button>
{/* on press go to today*/}
<button>today</button>
{/* on press go to previous month*/}
<button>
<ChevronRight size={22} />
</button>
</div>
);
};
return (
<ThemeProvider theme={theme}>
<Calendar
slots={{
calendarHeader: Header,
}} />
);
};
@LukasTy thanks!
do u may know how can change the view with custom header?
const DateCalendar: React.FC<DateCalendarProps<Date>> = (props) => { const Header = () => { return ( <div className="flex flex-row justify-center gap-8 "> {/* on press go to next month*/} <button> <ChevronLeft size={22} /> </button> {/* on press go to today*/} <button>today</button> {/* on press go to previous month*/} <button> <ChevronRight size={22} /> </button> </div> ); }; return ( <ThemeProvider theme={theme}> <Calendar slots={{ calendarHeader: Header, }} /> ); };
see this #13116 ... is this issue resolved and can be closed @ImamJanjua?
The issue has been inactive for 7 days and has been automatically closed.