| actions_block | R Documentation |
A block that is used to hold interactive elements.
actions_block(elements, id = NULL)
elements |
An array of interactive element objects: buttons, select menus, overflow menus, or date pickers. There is a maximum of 5 elements in each action block. |
id |
character, A string acting as a unique identifier for a block. Default: NULL |
Available in surfaces: Modals, Messages, Home tabs
actions_block class
Other layout:
as.blocks(),
context_block(),
divider_block(),
file_block(),
image_block(),
input_block(),
section_block(),
wrap_blocks()
# An actions block with a select menu and a button:
actions_block(
id = 'actions1',
elements = wrap_blocks(
select_menu(
placeholder = 'Which witch is the witchiest witch?',
id = 'select_2',
options = as.blocks(
lapply(c('Matilda','Glinda','Granny Weatherwax','Hermione'),
FUN = function(x){
block_option(
text = x,
value = gsub('\\s','',tolower(x))
)
})
)
),
button_element(
text = 'Cancel',
value = 'cancel',
id = 'button_1'
)
)
)
# An actions block with a datepicker, an overflow, and a button:
actions_block(
id = 'actionblock789',
elements = wrap_blocks(
datepicker_element(
id = 'datepicker123',
initial_date = '1990-04-28',
placeholder = 'Select a date'
),
overflow_menu(
id = 'overflow',
options = as.blocks(
lapply(sprintf('value-%d',1:4),block_option,
text = '*this is plain_text text*')
)
),
button_element(
text = 'Click Me',
value = 'click_me_123',
id = 'button'
)
)
)
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.