@_with_element
def checkbox(self, element, label, value=False, key=None):
    "Display a checkbox widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this checkbox is for.\n        value : bool\n            Preselect the checkbox when it first renders. This will be\n            cast to bool internally.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        bool\n            Whether or not the checkbox is checked.\n\n        Example\n        -------\n        >>> agree = st.checkbox('I agree')\n        >>>\n        >>> if agree:\n        ...     st.write('Great!')\n\n        "
    element.checkbox.label = label
    element.checkbox.default = bool(value)
    ui_value = _get_widget_ui_value('checkbox', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return bool(current_value)
Display a checkbox widget.

Parameters
----------
label : str
    A short label explaining to the user what this checkbox is for.
value : bool
    Preselect the checkbox when it first renders. This will be
    cast to bool internally.
key : str
    An optional string to use as the unique key for the widget.
    If this is omitted, a key will be generated for the widget
    based on its content. Multiple widgets of the same type may
    not share the same key.

Returns
-------
bool
    Whether or not the checkbox is checked.

Example
-------
>>> agree = st.checkbox('I agree')
>>>
>>> if agree:
...     st.write('Great!')
@_with_element
def checkbox(self, element, label, value=False, key=None):
    "Display a checkbox widget.\n\n        Parameters\n        ----------\n        label : str\n            A short label explaining to the user what this checkbox is for.\n        value : bool\n            Preselect the checkbox when it first renders. This will be\n            cast to bool internally.\n        key : str\n            An optional string to use as the unique key for the widget.\n            If this is omitted, a key will be generated for the widget\n            based on its content. Multiple widgets of the same type may\n            not share the same key.\n\n        Returns\n        -------\n        bool\n            Whether or not the checkbox is checked.\n\n        Example\n        -------\n        >>> agree = st.checkbox('I agree')\n        >>>\n        >>> if agree:\n        ...     st.write('Great!')\n\n        "
    element.checkbox.label = label
    element.checkbox.default = bool(value)
    ui_value = _get_widget_ui_value('checkbox', element, user_key=key)
    current_value = (ui_value if (ui_value is not None) else value)
    return bool(current_value)