checkbox_element.Rd
A checkbox group that allows a user to choose multiple items from a list of possible options.
checkbox_element(id, options, initial_options = NULL, confirm = NULL)
id | character, an identifier for the action triggered when the checkbox group is changed. |
---|---|
options | An list of block_option objects. |
initial_options | An list of block_option objects that exactly matches one or more of the options within options. Default: NULL |
confirm | A confirm object that defines an optional confirmation dialog that appears after clicking one of the checkboxes in this element. Default: NULL |
block element class
Works with block types: Section, Actions, Input
Other elements:
button_element()
,
datepicker_element()
,
image_element()
,
overflow_menu()
,
plaintext_element()
,
radiobuttons_element()
,
select_menu()
,
select_type_menu()
section_block( text = 'Check out these charming checkboxes', accessory = checkbox_element( id = 'my_checkbox', options = wrap_blocks( block_option( value = 'A1', text = 'Checkbox 1' ), block_option( value = 'A2', text = 'Checkbox 2' ) ), initial_options = wrap_blocks( block_option( value = 'A1', text = 'Checkbox 1' ) ) ) )#> { #> "type": "section", #> "text": "Check out these charming checkboxes", #> "accessory": { #> "type": "checkboxes", #> "action_id": "my_checkbox", #> "options": [ #> { #> "text": { #> "type": "plain_text", #> "text": "Checkbox 1" #> }, #> "value": "A1" #> }, #> { #> "text": { #> "type": "plain_text", #> "text": "Checkbox 2" #> }, #> "value": "A2" #> } #> ], #> "initial_options": [ #> { #> "text": { #> "type": "plain_text", #> "text": "Checkbox 1" #> }, #> "value": "A1" #> } #> ] #> } #> }