-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathIconButton.java
More file actions
24 lines (22 loc) · 830 Bytes
/
Copy pathIconButton.java
File metadata and controls
24 lines (22 loc) · 830 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
package elements;
import com.slack.api.model.block.Blocks;
import com.slack.api.model.block.ContextActionsBlock;
import com.slack.api.model.block.composition.BlockCompositions;
import com.slack.api.model.block.element.BlockElements;
import java.util.List;
/**
* An icon button to perform actions.
* {@link https://docs.slack.dev/reference/block-kit/block-elements/icon-button-element/}
*/
public class IconButton {
/**
* A context actions block with an icon button.
*/
public static ContextActionsBlock example01() {
ContextActionsBlock block = Blocks.contextActions(List.of(BlockElements.iconButton(ib -> ib.icon("trash")
.text(BlockCompositions.plainText("Delete"))
.actionId("delete_button")
.value("delete_item"))));
return block;
}
}