skillfed

st-annotated-text

A simple component to display annotated text in Streamlit apps.

st-annotated-text v4.0.2 301.6K downloads/30d#7,834 on PyPI567
Permissive license Apache 2 DORMANT released

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 on this page — 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

st-annotated-text on PyPI

pip

pip install st-annotated-text

uv

uv add st-annotated-text

poetry

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 the current Python release (>=3.5)
Install friction low — pure-Python wheel
Runtime dependencies 1 — htbuilder
Maintenance dormant — 568 days since the last release
Last repo commit
First released
Downloads 301,592/month — #7,834 on PyPI (30-day window, as of 2026-08-14)
Known vulnerabilities none known (OSV.dev, checked 2026-08-14)

Evidence: st_annotated_text-4.0.2-py3-none-any.whl

License :: OSI Approved :: Apache Software LicenseOperating System :: OS IndependentProgramming Language :: Python :: 3

Tags

streamlit text annotationlabeled text displayannotated text componenttext highlighting with labelsinline text markup
streamlit-componentnlp-visualization

More HTML packages