Working with the annotated_text feature

I am new to Streamlit and so far I find this to be a very cool tool for making UI’s quickly. I came across the annotated_text feature which allows users to highlight key words. I am not sure how to display the annotated text in a text window. For example, I can display the message, "Hello World! in a text box window by doing the following:

str=“Hello World!”
st.text_window(“test”,str)

But when I use the annotated_text feature to highlight for example a keyword I get a 'None" message in the window instead of the annotated text. I appreciate any help in solving this. Thanks!

import streamlit as st
from annotated_text import annotated_text

msg=[“Hello”,(“world”,“”)]
out=annotated_text(*msg)
st.text_area(“”,out)

image

annotated_text() creates a widget with the annotated text and returns None. I don’t think there is an easy way to put the annotated text inside the text_area widget.

Ok thank you for your feedback!

This topic was automatically closed 365 days after the last reply. New replies are no longer allowed.