Documentation

search

Search

  • rocket_launch

    Get started

    • Installation
      add
    • Fundamentals
      add
    • First steps
      add
  • code

    Develop

    • Concepts
      add
    • API reference
      remove
      • PAGE ELEMENTS
      • Write and magic
        add
      • Text elements
        add
      • Data elements
        add
      • Chart elements
        add
      • Input widgets
        add
      • Media elements
        add
      • Layouts and containers
        add
      • Chat elements
        add
      • Status elements
        add
      • Third-party componentsopen_in_new
      • APPLICATION LOGIC
      • Authentication and user info
        add
      • Navigation and pages
        add
      • Execution flow
        add
      • Caching and state
        add
      • Connections and secrets
        add
      • Custom components
        remove
        • st.components.v1​.declare_component
        • st.components.v1.html
        • st.components.v1.iframe
      • Configuration
        add
      • TOOLS
      • App testing
        add
      • Command line
        add
    • Tutorials
      add
    • Quick reference
      add
  • web_asset

    Deploy

    • Concepts
      add
    • Streamlit Community Cloud
      add
    • Snowflake
    • Other platforms
      add
  • school

    Knowledge base

    • FAQ
    • Installing dependencies
    • Deployment issues
  • Home/
  • Develop/
  • API reference/
  • Custom components

Custom components

Declare a component

Create and register a custom component.

from st.components.v1 import declare_component declare_component( "custom_slider", "/frontend", )

HTML

Display an HTML string in an iframe.

from st.components.v1 import html html( "<p>Foo bar.</p>" )

iframe

Load a remote URL in an iframe.

from st.components.v1 import iframe iframe( "docs.streamlit.io" )
Previous: Connections and secretsNext: st.components.v1​.declare_component
forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.


HomeContact UsCommunity
© 2025 Snowflake Inc.