ui.input_checkbox
ui.input_checkbox(id, label, value=False, *, width=None)
Create a checkbox that can be used to specify logical values.
Parameters
Returns
Type | Description |
---|---|
Tag | A UI element. |
Notes
Server value
True
if checked, False
otherwise.
See Also
Examples
#| standalone: true
#| components: [editor, viewer]
#| layout: vertical
#| viewerHeight: 400
## file: app.py
from shiny import App, Inputs, Outputs, Session, render, ui
app_ui = ui.page_fluid(
ui.input_checkbox("somevalue", "Some value", False),
ui.output_ui("value"),
)
def server(input: Inputs, output: Outputs, session: Session):
@render.ui
def value():
return input.somevalue()
app = App(app_ui, server)