How to the whiltespace of text element to pre-wrap

Hi @llan-ml

I see 2 possible approaches for this as the current st.text does not have a parameter that can be set to specify the use of pre-wrap.

  1. Create a custom component (more info on how to do this which also supports the use of Typescript is described in this blog How to build your own Streamlit component)
  2. Customize the CSS styling of the rendered st.text in order to mimic the desired visual display (further info on how to do this in this recent post that I wrote Buttons on top of the chat input - #2 by dataprofessor)

Hope this helps!