# ComponentRenderer

Source: https://docs.streamlit.io/develop/api-reference/custom-components/st.components.v2.types.componentrenderer

* Function signature:

   ```python
   ComponentRenderer(*args, **kwargs)
   ```

* Parameters:

   | name | type | default | description |
   |---|---|---|---|
   | key | str, int, or None |  | An optional string or integer to use as the unique key for the component instance. If this is omitted, an internal key is generated for the component instance based on its mounting parameters. No two Streamlit elements may have the same key. When a key is defined, the component's state is available in Session State via the key.  Note If you want to access this key in your component's frontend, you must pass it explicitly within the data parameter. The key parameter in ComponentRenderer is not the same as the key property in FrontendRendererArgs in the component's frontend code. The frontend key is automatically generated to be unique among all instances of all components and to avoid collisions with classes and IDs in the app's DOM. |
   | data | Any or None |  | Data to pass to the component. This can be one of the following:  A JSON-serializable object, like Dict[str, str | int] or List[str]. An Arrow-serializable object, like pandas.DataFrame. Raw bytes. A dictionary of JSON-serializable and Arrow-serializable objects. The dictionary's keys must be Python primitives.  Because this data is sent to the frontend, it must be serializable by one of the supported serialization methods (JSON, Arrow, or raw bytes). You can't pass arbitrary Python objects. Arrow-serialization is only supported at the top level of the data parameter or one level deep in a dictionary. Raw bytes are only supported at the top level. |
   | default | dict[str, Any] or None | state | Default state values for the component. Each key in the dictionary must correspond to a valid state attribute with an on__change callback. This callback can be empty, but must be included as a parameter when the component is mounted. Trigger values do not support manual defaults. All trigger and state values defined by an associated callback are initialized to None by default. |
   | width | "stretch", "content", or int |  | Width of the component. This can be one of the following:  "stretch" (default): The component is wrapped in a  with CSS style width: 100%;. "content": The component is wrapped in a  with CSS style width: fit-content;. An integer specifying the width in pixels: The component is wrapped in a  with the specified pixel width.  You are responsible for ensuring the component's inner HTML content is responsive to the  wrapper. |
   | height | "content", "stretch", or int |  | Height of the component. This can be one of the following:  "content" (default): The component is wrapped in a  with CSS style height: auto;. "stretch": The component is wrapped in a  with CSS style height: 100%;. An integer specifying the height in pixels: The component is wrapped in a  with the specified pixel height. If the component content is larger than the specified height, scrolling is enabled.   Note Use scrolling containers sparingly. If you use scrolling containers, avoid heights that exceed 500 pixels. Otherwise, the scroll surface of the container might cover the majority of the screen on mobile devices, which makes it hard to scroll the rest of the app. If you want to disable scrolling for a fixed-height component, include an inner  wrapper in your component's HTML to control the overflow behavior.  You are responsible for ensuring the component's inner HTML content is responsive to the  wrapper. |
   | **callbacks | Callable or None |  | Callbacks with the naming pattern on__change for each state and trigger key. For example, if your component has a state key of "value" and a trigger key of "click", its callbacks can include on_value_change and on_click_change. Only names that follow this pattern are recognized. Custom components don't currently support callbacks with arguments. Callbacks are required for any state values defined in the default parameter. Otherwise, a callback is optional. To ensure your component's result always returns the expected attributes, you can pass empty callbacks like lambda: None. |

* Returns: ComponentResult

    Component state object that exposes state and trigger values.

[Function 'ComponentResult' not found]
