checkbox_element: Checkbox groups

View source: R/elements.R

checkbox_elementR Documentation

Checkbox groups

Description

A checkbox group that allows a user to choose multiple items from a list of possible options.

Usage

checkbox_element(id, options, initial_options = NULL, confirm = NULL)

Arguments

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

Details

Works with block types: Section, Actions, Input

Value

block element class

See Also

checkClass

Other elements: button_element(), datepicker_element(), image_element(), overflow_menu(), plaintext_element(), radiobuttons_element(), select_menu(), select_type_menu()

Examples

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'
   )
 )
)
)

yonicd/slackblocks documentation built on March 2, 2023, 6:53 a.m.