Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Add small text via Markdown (:small[foo]) #10486

@jrieke

Description

@jrieke

Checklist

  • I have searched the existing issues for similar feature requests.
  • I added a descriptive title and summary to this issue.

Summary

We already support several Markdown extensions, e.g. to write colored text via st.markdown(":red[foo]"). What if we did the same thing for small text, e.g. via st.markdown(":small[foo]")?

Why?

This can be used for several cool things:

  • Replicate the same styling as widget labels outside of a widget. This is especially helpful if you put a widget and another element next to each other. Today, you can't get the same style as a widget label because st.markdown is too big and st.caption is gray.
  • Making small badges via :small[:orange-background[:orange[tag]]].
  • Using big and small text in the same element, e.g. for the badges in our roadmap app.

How?

Just add a new Markdown extension, similar to the one for colored text. We should make sure all these extensions also work together properly.

Potentially, we could also make st.caption simply be st.markdown(":small[:gray[foo]]") then! Even though today st.caption uses a slightly different gray than colored text.

Additional Context

No response

Metadata

Metadata

Assignees

No one assigned

    Labels

    feature:markdownRelated to Markdown renderingfeature:st.captionRelated to the `st.caption` elementtype:enhancementRequests for feature enhancements or new features

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions