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.
- Host: GitHub
- URL: https://github.com/springrole/block-kit-builder
- Owner: SpringRole
- Created: 2022-02-11T11:28:22.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2022-04-28T04:06:27.000Z (about 4 years ago)
- Last Synced: 2025-02-16T17:55:13.473Z (over 1 year ago)
- Language: JavaScript
- Size: 48.8 KB
- Stars: 1
- Watchers: 5
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
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).