The base interface for defining a Streamlit custom component's state shape.

import { ComponentState } from '@streamlit/component-v2-lib';

Component state is a persistent key-value store of state and trigger values. You can extend this type or define your own interface to add type-safe state and trigger key-value pairs. Each key corresponds to an on_<key>_change callback parameter in Python.

(TypeScript) Type alias description[source]

ComponentState = Record<string, unknown>

forum

Still have questions?

Our forums are full of helpful information and Streamlit experts.