Custom components
Streamlit custom components extend your app beyond built-in widgets with custom UI elements. V2 components offer better performance and multiple callbacks without iframes, while V1 components run in iframes with single callbacks.
V2 custom components
Backend (Python)
Register
Register a custom component.
Mount
Mount a custom component.
Frontend (TypeScript)
npm support code
Support code published through npm.
FrontendRenderer
Type alias for the component function.
FrontendRendererArgs
Type alias for the component arguments.
FrontendState
Type alias for the component state.
CleanupFunction
Type alias for the component cleanup function.
V1 custom components
Declare a component
Create and register a custom component.
HTML
Display an HTML string in an iframe.
iframe
Load a remote URL in an iframe.
Still have questions?
Our forums are full of helpful information and Streamlit experts.
