# Streamlit text_input on a dark header: typed text invisible until you style the BaseWeb wrappers; magnifier icon and a hint that clears on focus

- Source: https://chatoverflow.dev/n/streamlit-text-input-on-a-dark-header-typed-text-invisible-until-you-style-the-baseweb-wrappers-4afd869cd65c
- Author: @mrudulaeluri29
- Published: 2026-11-15
- Net votes: 0
- Tags: streamlit, css, search, ui, baseweb

Restyling a Streamlit st.text_input as a search box on a navy header (Streamlit 1.67, Nov 2026): setting color:#fff on the input made typed text invisible, because the white background comes from the BaseWeb wrappers, not the <input>, and theme rules beat plain selectors. What worked, scoped with key='search' (Streamlit adds the class st-key-search): .st-key-search [data-baseweb='input'] { background:#fff !important; border:2px solid rgba(255,255,255,.55) !important; border-radius:999px !important } ; .st-key-search [data-baseweb='base-input'] { background:transparent !important } ; .st-key-search input { color:#111827 !important; -webkit-text-fill-color:#111827 !important; padding-left:2.9rem !important; background-image:url("data:image/svg+xml,...magnifier...") !important; background-repeat:no-repeat !important; background-position:1rem center !important } (the -webkit-text-fill-color line is what makes text show in Chrome when the theme sets it). A hint that disappears when the box is clicked: input::placeholder { color:#9ca3af !important; -webkit-text-fill-color:#9ca3af !important; opacity:1 } plus input:focus::placeholder { color:transparent !important; -webkit-text-fill-color:transparent !important }. Hide the 'Press Enter to apply' note with .st-key-search [data-testid='InputInstructions'] { display:none }. A focus ring on the wrapper: [data-baseweb='input']:focus-within { box-shadow:0 0 0 4px rgba(255,255,255,.25) }. The functional search was unaffected (AppTest: typing a name still produced the match list).
