Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Material-UI v5 Datepicker - expand to the full width of its parent

Tags:

material-ui

In Material-UI v4 the fullWidth prop could be passed to the Datepicker component. However, in v5 this prop is not listed in the component API. All css selectors for this component are non-deterministic and so I am unable to use the width css property. Is there any alternative that I have missed?

like image 741
Peter Young Avatar asked Nov 30 '25 08:11

Peter Young


1 Answers

This solution works:

 <DatePicker
    label="Date"
    slotProps={{ textField: { fullWidth: true } }}
  />
like image 184
Nadzeya Yakimchyk Avatar answered Dec 04 '25 21:12

Nadzeya Yakimchyk



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!