| calcite_checkbox | R Documentation |
A checkbox allows users to make a binary selection, typically within a form or as a standalone toggle. Supports indeterminate state for tri-state behavior.
calcite_checkbox(
id = NULL,
checked = NULL,
disabled = NULL,
form = NULL,
indeterminate = NULL,
label = NULL,
label_text = NULL,
name = NULL,
required = NULL,
scale = NULL,
status = NULL,
value = NULL
)
id |
Component ID (required for Shiny reactivity) |
checked |
When |
disabled |
When |
form |
Specifies the id of the component's associated form. |
indeterminate |
When |
label |
Specifies an accessible label for the component. |
label_text |
Specifies the component's label text. |
name |
Specifies the name of the component. Required to pass the component's value on form submission. |
required |
When |
scale |
Specifies the size of the component: |
status |
Specifies the status of the input field: |
value |
The component's value. |
When an id is provided, the checkbox emits its state whenever it changes.
Available properties in input$id:
$checked - Whether the checkbox is checked
$indeterminate - Whether the checkbox is in indeterminate state
$value - The component's value
$disabled - Whether the checkbox is disabled
$name - The component's name
$scale - The component's scale
$status - The component's status
Events:
calciteCheckboxChange - Fires when the checked status changes
An object of class calcite_component
calcite_checkbox(id = "agree", label_text = "I agree to the terms")
calcite_checkbox(
id = "opt_in",
label_text = "Subscribe to newsletter",
checked = TRUE,
scale = "l"
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.