An open API service indexing awesome lists of open source software.

https://github.com/springrole/block-kit-builder

Provides reusable Slack blocks used to create views for modal/messages/app homes for any slack app.
https://github.com/springrole/block-kit-builder

Last synced: 5 months ago
JSON representation

Provides reusable Slack blocks used to create views for modal/messages/app homes for any slack app.

Awesome Lists containing this project

README

          

# @springrole/block-kit-builder

## Getting started

This is a simple package that can be used to create the blocks and views required to interact with users on any Slack surface. This is based on Slack's own [Block Kit Builder](https://app.slack.com/block-kit-builder/).

### Installation

```console
npm install --save @springrole/block-kit-builder
```

---
### Usage

```javascript
const BlockKitBuilder = require("@springrole/block-kit-builder");

const blocks = BlockKitBuilder.Blocks.markdown({
text: "Hello world!",
blockId: "hello_block",
...BlockKitBuilder.Accessory.button({
text: "Click me!",
style: "primary",
actionId: "click",
value: "something",
}),
});

// OR

const { Blocks, Accessory } = require("@springrole/block-kit-builder");
const blocks = Blocks.markdown({
text: "Hello world!",
blockId: "hello_block",
...Accessory.button({
text: "Click me!",
style: "primary",
actionId: "click",
value: "something",
}),
});
```
---
### License
@springrole/block-kit-builder is licensed under the [MIT License](https://github.com/iamkun/dayjs/blob/HEAD/LICENSE).