Responsive Calendar
The date & time has a liquid layout, which means it nicely adapts to its surroundings. There are times however when you would like to set up the component responsively.
Use the responsive option to configure the picker and change the options based on the viewport width. There are five predefined breakpoints:
xsmall- min-width: 0pxsmall- min-width: 576pxmedium- min-width: 768pxlarge- min-width: 992pxxlarge- min-width: 1200px- use
customfor setting a custombreakpoint
It is a good idea to change the display or controls option to tailor the UX. This way you can have a bottom positioned calendar on mobile, a popover anchored to the input on tablet and desktop display on large screens.
Demo
responsive: {
}
mobiscroll.setOptions({
locale: ,
theme: ' ',
themeVariant: ' '
});
mobiscroll.datepicker('#demo-responsive', {
controls: ['calendar'],
responsive: {
xsmall: {
display: 'bottom',
},
small: {
display: 'anchored',
},
custom: {
// Custom breakpoint
breakpoint: 800,
display: 'anchored',
touchUi: false,
},
},
});
<label>
<input id="demo-responsive" mbsc-input data-label-style="stacked" data-input-style="box" placeholder="Please Select..." />
</label>