streamlit / streamlit

Streamlit — A faster way to build and share data apps.
https://streamlit.io
Apache License 2.0
38.3k stars 3.33k forks source link

Support masked input in `st.text_input` #10745

Open lukasmasuch opened 1 week ago

lukasmasuch commented 1 week ago

Checklist

Summary

Allow the user to specify a mask for st.text_input to enforce specific input formats:

Image

Image

Why?

No response

How?

st.text_input("Phone number", mask="(999) 999-9999")

Additional Context

github-actions[bot] commented 1 week ago

To help Streamlit prioritize this feature, react with a 👍 (thumbs up emoji) to the initial post.

Your vote helps us identify which enhancements matter most to our users.

Visits

mdrazak2001 commented 4 days ago

Hi @lukasmasuch, I've created a PR to implement this feature. Could you have a look and let me know in case of any issues. Thanks!