The Streamlit v2 Component signature.
This type represents the function signature for the default export from your component's JavaScript or TypeScript code. This function gets called by Streamlit when your component is mounted in the frontend, and it receives all the necessary arguments to build and manage your component's UI and state.
| (TypeScript) Type alias description[source] | |
|---|---|
Component<TComponentState extends ComponentState = ComponentState, TDataShape = unknown> = (componentArgs: ComponentArgs<TComponentState, TDataShape>) => OptionalComponentCleanupFunction | |
| Arguments | |
componentArgs (ComponentArgs<TComponentState, TDataShape>) | The inputs and utilities provided by Streamlit to your component. |
| Returns | |
(OptionalComponentCleanupFunction) | An optional cleanup function that Streamlit will call when the component is unmounted. |
Still have questions?
Our forums are full of helpful information and Streamlit experts.
