select_menu: Select menu element

View source: R/elements.R

select_menuR Documentation

Select menu element

Description

A select menu, just as with a standard HTML select tag, creates a drop down menu with a list of options for a user to choose. The select menu also includes type-ahead functionality, where a user can type a part or all of an option string to filter the list.

Usage

select_menu(
  id,
  placeholder,
  options,
  option_groups = NULL,
  initial_option = NULL,
  confirm = NULL,
  max_select_items = NULL
)

Arguments

id

character, an identifier for the action triggered when a menu option is selected.

placeholder

character, defines the placeholder text shown on the menu.

options

list, a list of option objects.

option_groups

a list of option group objects. Default: NULL

initial_option

a single option that exactly matches one of the options within options or option_groups, Default: NULL

confirm

A confirm object that defines an optional confirmation dialog that appears after a menu item is selected. Default: NULL

max_select_items

integer, Specifies the maximum number of items that can be selected in the menu, Default: NULL

Details

Works with block types: Section, Actions, Input

If options is specified, then option_groups should not be and vice versa.

Value

block menu class

See Also

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

Examples

section_block(
id = 'section678',
text = 'Pick an item from the dropdown list',
accessory = select_menu(
 id = 'text1234',
 placeholder = 'Select an item',
 options = as.blocks(
   lapply(sprintf('value-%d',1:4),block_option,
     text = '*this is plain_text text*')
   )
 )
)

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