button_element.Rd
An interactive component that inserts a button. The button can be a trigger for anything from opening a simple link to starting a complex workflow.
button_element( id, text, value = NULL, url = NULL, style = NULL, confirm = NULL )
id | character, An identifier for this action. |
---|---|
text | character, text of the button |
value | The value to send along with the interaction payload. Default: NULL |
url | character, A URL to load in the user's browser when the button is clicked. Default: NULL |
style | Decorates buttons with alternative visual color schemes, Default: NULL |
confirm | block_confirm, defines an optional confirmation dialog after the button is clicked. Default: NULL |
block element class
Works with block types: Section, Actions
primary gives buttons a green outline and text, ideal for affirmation or confirmation actions.
primary should only be used for one button within a set.
danger gives buttons a red outline and text, and should be used when the action is destructive.
Use danger even more sparingly than primary.
If you don't include this field, the default button style will be used.
Other elements:
checkbox_element()
,
datepicker_element()
,
image_element()
,
overflow_menu()
,
plaintext_element()
,
radiobuttons_element()
,
select_menu()
,
select_type_menu()
# A regular interactive button: button_element(text = 'Click Me', value = 'click_me_123', id = 'button')#> { #> "type": "button", #> "text": { #> "type": "plain_text", #> "text": "Click Me" #> }, #> "action_id": "button", #> "value": "click_me_123" #> }# A button with a primary style attribute: button_element(text = 'Click Me', value = 'click_me_123', id = 'button',style = 'primary')#> { #> "type": "button", #> "text": { #> "type": "plain_text", #> "text": "Click Me" #> }, #> "action_id": "button", #> "value": "click_me_123", #> "style": "primary" #> }# A link button: button_element(text = 'Link Button', url = 'https://api.slack.com/block-kit', id = 'button')#> { #> "type": "button", #> "text": { #> "type": "plain_text", #> "text": "Link Button" #> }, #> "action_id": "button", #> "url": "https://api.slack.com/block-kit" #> }