Skip to main content

Attributes

id
str
The identifier used to retrieve the widget value from the settings.
label
str
The label displayed next to the checkbox.
initial
bool
default:false
The initial checked state of the checkbox.
tooltip
str
The tooltip text shown when hovering over the label.
description
str
The text displayed underneath the input widget.

Usage

Code Example
import chainlit as cl
from chainlit.input_widget import Checkbox


@cl.on_chat_start
async def start():
    settings = await cl.ChatSettings(
        [
            Checkbox(
                id="VerboseMode",
                label="Enable verbose output",
                initial=False,
            )
        ]
    ).send()
    value = settings["VerboseMode"]