timepicker-ui
4.7.0GitHub
timepicker-ui
Basic Examples / With Backdrop

Backdrop

Control backdrop overlay behavior

With Backdrop (Default)

#

Backdrop is enabled by default and darkens the background:

const picker = new TimepickerUI(input, {
ui: { backdrop: true } // This is the default
});
picker.create();

Without Backdrop

#

Disable backdrop to keep background visible:

const picker = new TimepickerUI(input, {
ui: { backdrop: false }
});
picker.create();

Backdrop with Scroll

#

Let the page scroll while the backdrop is visible:

const picker = new TimepickerUI(input, {
ui: {
backdrop: true,
allowPageScroll: true
}
});
picker.create();

Backdrop with Focus Trap

#

Combine backdrop with focus trap for better accessibility:

const picker = new TimepickerUI(input, {
ui: {
backdrop: true
},
behavior: {
focusTrap: true,
returnFocus: true
}
});
picker.create();

No Backdrop, No Animation

#

Minimal setup without backdrop and animations:

const picker = new TimepickerUI(input, {
ui: {
backdrop: false,
animation: false
}
});
picker.create();
Esc