Skip to main content

Text Input

A widget that includes a text input parameter allowing users to enter custom text. The entered text is passed to the widget as a parameter.

Text Input Parameter Example
@register_widget({
"name": "Markdown Widget with Text Input",
"description": "A markdown widget with a text input parameter",
"endpoint": "markdown_widget_with_text_input",
"gridData": {"w": 16, "h": 6},
"type": "markdown",
"params": [
{
"paramName": "text_box",
"value": "hello",
"label": "Enter Text",
"description": "Type something to display",
"type": "text"
}
]
})
@app.get("/markdown_widget_with_text_input")
def markdown_widget_with_text_input(text_box: str):
"""Returns a markdown widget with text input parameter"""
return f"""# Text Input
Entered text: {text_box}
"""