DatePickerPopup
Use a date picker to let the user select a date.
import { DatePickerPopup, FilledButton } from "@material";export component Example inherits Window { width: 400px; height: 600px;
date_picker_button := FilledButton { text: @tr("Open Date Picker");
clicked => { date_picker.show(); } }
date_picker := DatePickerPopup { x: (root.width - self.width) / 2; y: (root.height - self.height ) / 2; close_policy: PopupClosePolicy.no_auto_close;
accepted(date) => { date_picker.close(); } canceled => { date_picker.close(); } }}
slint
Properties
Section titled “Properties”string default: ""
The text that is displayed at the top of the picker.
struct Date default: a struct with all default values
Set the initial displayed date.
DatePickerPopup { date: { year: 2024, month: 11 };}
slint
close-policy
Section titled “close-policy”enum PopupClosePolicy default: close_on_click
By default, a DatePickerPopup closes when the user clicks. Set this to false to prevent that behavior and close it manually using the close()
function.
Callbacks
Section titled “Callbacks”canceled()
Section titled “canceled()”Invoked when the cancel button is clicked.
date_picker := DatePickerPopup { canceled() => { date_picker.close(); }}
slint
accepted(Date)
Section titled “accepted(Date)”Invoked when the ok button is clicked.
date_picker := DatePickerPopup { accepted(date) => { debug("Selected date: ", date); date_picker.close(); }}
slint
Properties
Section titled “Properties”has-focus
Section titled “has-focus”bool default: false
Whether the component has focus.
Functions
Section titled “Functions”clear-focus()
Section titled “clear-focus()”Clears the focus from the component.
close()
Section titled “close()”Closes the popup. Use this if you set the close_policy
property to no_auto_close
.
focus()
Section titled “focus()”Focuses the component.
show()
Section titled “show()”Show the popup on the screen.
© 2025 SixtyFPS GmbH