--- id: st-annotated-text version: "4.0.2" license: Apache 2 license_treatment: permissive maintenance: dormant --- # st-annotated-text — A simple component to display annotated text in Streamlit apps. License: permissive · Maintenance: dormant · Downloads: 301.6K/mo ## What it is and what it does st-annotated-text is a Streamlit component that renders text with inline annotations—labels, highlights, or custom styling applied to specific words or phrases. It wraps htbuilder to generate HTML markup and integrates into Streamlit apps via the annotated_text() function. You pass the function a mix of plain strings and tuples; each tuple contains text to annotate plus a label, and optionally CSS color strings for background and foreground. The component renders the result as styled HTML in your UI. It's designed for scenarios where you need to highlight and label portions of text inline without building custom HTML yourself. Use it for: - Display named entity recognition results with entity type labels on extracted text - Highlight parts of speech or grammatical annotations in linguistic analysis tools - Show sentiment or topic labels on text passages in data exploration dashboards - Visualize text classification predictions with category labels ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Displays annotated text with labels and optional styling in Streamlit apps, accepting strings, tuples with annotations, or htbuilder elements for flexible markup. Yes, if you're building a Streamlit app that needs to display annotated or labeled text. Low install friction, no security issues, and permissive license make it straightforward. Dormant maintenance is not a blocker for a stable, single-purpose component; verify color customization and rendering work with your Streamlit version. ## Install pip install st-annotated-text uv add st-annotated-text poetry add st-annotated-text ## Installing st-annotated-text Before you install: Low friction: pure Python wheel with a single runtime dependency (htbuilder). Dormant maintenance status—last commit January 2025—but stable and suitable for a single-purpose component. License in practice: Apache 2 permissive license allows commercial and private use with minimal restrictions; suitable for most projects. Quickstart: pip install st-annotated-text from st_annotated_text import annotated_text annotated_text( "This ", ("is", "verb"), " some ", ("annotated", "adj"), ("text", "noun") ) Designed for use within Streamlit applications; requires Streamlit to be installed separately. Verify before relying: - Whether background and foreground color customization works reliably across Streamlit versions - Performance characteristics with large annotated text blocks or many annotations - Integration requirements and compatibility with current Streamlit releases ## Package facts - License: Apache 2 (permissive) - Python support: supports_current - Install friction: low - Maintenance: dormant - Downloads: 301.6K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags streamlit text annotation, labeled text display, annotated text component, text highlighting with labels, inline text markup, streamlit-component, nlp-visualization [View on SkillFed](https://skillfed.io/packages/st-annotated-text) · [View on PyPI](https://pypi.org/project/st-annotated-text/)