| calcite_option | R Documentation |
Option provides a selectable item within a calcite_select() component.
Each option represents a single choice in the select dropdown menu.
calcite_option(label, value, disabled = NULL, selected = NULL, ...)
label |
Text label for the option (required for accessibility) |
value |
The component's value (can be any type) |
disabled |
When true, interaction is prevented and the component is displayed with lower opacity |
selected |
When true, the component is selected |
... |
Additional attributes passed to the component |
Options are used within calcite_select() to define the available choices.
The value parameter determines what value will be sent to Shiny when the
option is selected.
An object of class calcite_component
# Basic option
calcite_option(
label = "First Option",
value = "1"
)
# Selected option
calcite_option(
label = "Default Selection",
value = "default",
selected = TRUE
)
# Disabled option
calcite_option(
label = "Unavailable",
value = "unavailable",
disabled = TRUE
)
# Use with calcite_select
calcite_select(
id = "my_select",
label = "Choose one",
calcite_option(label = "Option 1", value = "1"),
calcite_option(label = "Option 2", value = "2", selected = TRUE),
calcite_option(label = "Option 3", value = "3")
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.