A section is one of the most flexible blocks available, it can be used as a simple text block, in combination with text fields, or side-by-side with any of the available block elements.

section_block(text, id = NULL, fields = NULL, accessory = NULL)

Arguments

text

character, The text for the block, in the form of a text object. Maximum length for the text in this field is 3000 characters.

id

character, A string acting as a unique identifier for a block. Default: NULL

fields

An array of text objects. Any text objects included with fields will be rendered in a compact format that allows for 2 columns of side-by-side text. Maximum number of items is 10., Default: NULL

accessory

One of the available element objects. Default: NULL

Value

section_block class

Details

Available in surfaces: Modals, Messages, Home tabs

See also

Examples

section_block( text = block_text( text = "A message *with some bold text* and _some italicized text_." ) )
#> { #> "type": "section", #> "text": { #> "type": "mrkdwn", #> "text": "A message *with some bold text* and _some italicized text_." #> } #> }
section_block( text = block_text( text = "A message *with some bold text* and _some italicized text_." ), fields = wrap_blocks( block_text(text = 'High'), block_text( type = 'plain_text', text = 'string', emoji = TRUE) ) )
#> { #> "type": "section", #> "text": { #> "type": "mrkdwn", #> "text": "A message *with some bold text* and _some italicized text_." #> }, #> "fields": [ #> { #> "type": "mrkdwn", #> "text": "High" #> }, #> { #> "type": "plain_text", #> "text": "string", #> "emoji": true #> } #> ] #> }
section_block( text = block_text( text = "*Sally* has requested you set the deadline for the Nano launch project" ), accessory = datepicker_element( id = 'datepicker123', initial_date = "1990-04-28", placeholder = 'Select a date' ) )
#> { #> "type": "section", #> "text": { #> "type": "mrkdwn", #> "text": "*Sally* has requested you set the deadline for the Nano launch project" #> }, #> "accessory": { #> "type": "datepicker", #> "placeholder": { #> "type": "plain_text", #> "text": "Select a date" #> }, #> "action_id": "datepicker123", #> "initial_date": "1990-04-28" #> } #> }