-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[DatePicker] smaller static date picker on desktop #27700
Comments
Agree, we didn't solve it in the original repo, see the same unresolved issue: mui/material-ui-pickers#1648. |
Thank you very much, today it seems like there's still zero options to change the size of a static picker in a simple way. I changed the classnames with the Here's mine : sx={{
'& > div > div': {
minWidth: 256,
},
[`& > div > div, & > div > div > div, & > div > div > div > div, & .${calendarPickerClasses.root}`]: {
width: 256,
},
[`& .${pickersCalendarHeaderClasses.root}`]: {
minHeight: '34px',
maxHeight: '34px',
paddingLeft: '16px',
paddingRight: '8px',
},
[`& .${pickersCalendarHeaderClasses.labelContainer}`]: {
maxHeight: '34px',
},
[`& .${typographyClasses.caption}`]: {
width: DATE_SIZE,
margin: 0,
},
[`& .${pickersSlideTransitionClasses.root}`]: {
minHeight: DATE_SIZE * 6,
},
[`& .${pickersSlideTransitionClasses.root} [role="row"]`]: {
margin: 0,
},
[`& .${pickersDayClasses.root}`]: {
width: DATE_SIZE,
height: DATE_SIZE,
},
[`& .${pickersDayClasses.dayWithMargin}`]: {
margin: 0,
},
}} |
Summary 💡
I'd like the static date picker to be smaller on desktop, perhaps matching the material ui specification:
The specification describes a total width of 256 pixels. material-ui's implementation is 320 pixels wide. This is wide enough to be problematic for my layout.
I'd prefer smaller by default, but a well-supported way to customize sizing would also be fine with me.
Examples 🌈
https://codesandbox.io/s/relaxed-fermat-o3htk?file=/src/Demo.tsx shows both the original formatting and roughly the formatting I'd like. The latter I managed to get with
<Box sx={{...}}>
(quoting the relevant part below). Unfortunately, it's ridiculously fragile. Eg, I had to adapt it when upgrading from5.0.0-alpha.26
to5.0.0-beta.3
.Motivation 🔦
I'm writing a network video recorder and want a design with a static datepicker in a column. It's static rather than a pop-up because it displays useful context about what dates have video/motion/etc. But space is precious; I have a large main column of video (or tabular data or whatever) to show. So I don't want big touch-friendly targets when I'm on desktop with a mouse or trackpad available.
The text was updated successfully, but these errors were encountered: