Interface: Button
Description
Allows users a direct path to performing basic actions.
See
- Button element reference.
- This is an interactive component - see our guide to enabling interactivity.
Extends
Properties
accessibility_label?
optional accessibility_label: string;
Description
A label for longer descriptive text about a button element. This label will be read out by screen
readers instead of the button text
object. Maximum length for this field is 75 characters.
Defined in
block-kit/block-elements.ts:63
action_id?
optional action_id: string;
@description: An identifier for this action. You can use this when you receive an interaction payload to
identify the source of the action. Should be unique
among all other action_id
s in the containing block. Maximum length for this field is 255 characters.
Inherited from
Defined in
confirm?
optional confirm: ConfirmationDialog;
Description
A Confirm object that defines an optional confirmation dialog after the element is interacted with.
Inherited from
Defined in
style?
optional style: ColorScheme;
Description
Decorates buttons with alternative visual color schemes. Use this option with restraint.
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.
Defined in
block-kit/block-elements.ts:58
text
text: PlainTextElement;
Description
A PlainTextElement that defines the button's text. text
may truncate with ~30 characters.
Maximum length for the text in this field is 75 characters.
Defined in
block-kit/block-elements.ts:38
type
type: "button";
Description
The type of element. In this case type
is always button
.
Overrides
Defined in
block-kit/block-elements.ts:33
url?
optional url: string;
Description
A URL to load in the user's browser when the button is clicked. Maximum length for this field is 3000
characters. If you're using url
, you'll still receive an interaction payload
and will need to send an acknowledgement response.
Defined in
block-kit/block-elements.ts:49
value?
optional value: string;
Description
The value to send along with the interaction payload. Maximum length for this field is 2000 characters.