CustomInput
Custom HTML input widget for creating custom interactive components.
Examples
Basic Usage
This example runs a CustomInput that gets the current date from the user's browser
Example Code
Parameters
| Name | Description | Type | Default |
|---|---|---|---|
| html_body (required) | HTML content for the body of the custom component. | str | None |
| key | Identifier for the widget, defaults to hash of html_body if not provided. | str | None |
| required | Whether the component must be filled before proceeding. | bool | True |
| label | Text label displayed above the component. | str | '' |
| html_head | HTML content for the head section. | str | '' |
| height | Height of the component in pixels. | int | 200 |
| css | CSS styles for the component. | str | '' |
| js | JavaScript code for the component. | str | '' |
| full_width | Whether the component should take up the full width of its container. | bool | False |
| change_event | Function to process value changes before storing. | Callable | None |
| errors | Pre-defined validation error messages to display. | Union[List[str], str] | None |
State Value
Any: The value returned by the custom component.
This is the type of the value that this widget holds. It will show up when accessing widget's state item.
This also defines which value type can be used on initial_state