"Today" button for date input

I often have a use case where a date input is set to some time in the past, say 1/1/2000. If I want to let the user update this to the current date, it involves selecting both the current year and month from the dropdowns within the widget manually.

It would be ideal if there was a small button right next to those dropdowns that would snap the selection to the current date and also not close the widget. This would just allow a user to get to “today” within the widget more easily, then select whatever date they want.

Does this exist? Illustration attached.

Thank you

Welcome to the Streamlit community, and thanks for your thoughtful question! :balloon: Currently, Streamlit’s built-in st.date_input widget does not provide a “Today” button or shortcut within the calendar dropdown to quickly jump to the current date. Users must manually navigate through the year and month selectors to reach today’s date if the initial value is far in the past. This feature is not available in the official API or widget configuration options as of the latest release.

If you’d like to see this feature added, you can upvote or comment on related feature requests in the Streamlit GitHub repository. For now, you might consider adding a separate button in your app UI (outside the widget) that sets the date input’s value to today via session state, but this will close and reopen the widget, not keep it open as you described. For more details, see the st.date_input documentation and related feature discussions.

Sources:

If you’re interested, the st-rsuite custom component does have a today and yesterday button built-in.

You can install it with uv add st-rsuite or pip install st-rsuite

https://rsuite.streamlit.app/

This looks like just the ticket, but I am running Streamlit in Snowflake and it appears this package is not available to me.

I think a “Today” button would be a really useful addition. Having to manually navigate from an old date to the current date can be a bit tedious. A small shortcut that keeps the calendar open would make the date picker much easier to use.