slack-blockx
v0.3.1
Published
jsx for Slack block-kit
Downloads
7
Readme
slack-blockx
jsx for Slack block-kit
Installation
yarn add slack-blockx
Usage
/** @jsx createBlock */
import { createBlock } from 'slack-blockx';
console.log(
<blocks>
<actions>
<button>Button</button>
</actions>
</blocks>
);
// Logs:
// {
// "blocks": [
// {
// "type": "actions",
// "elements": [
// {
// "type": "button",
// "text": {
// "type": "plain_text",
// "emoji": true,
// "text": "Button"
// }
// }
// ]
// }
// ]
// }
Usage without compiler
const { jsx } = require('slack-blockx');
console.log(jsx`
<blocks>
<actions>
<button>Button</button>
</actions>
</blocks>
`); // Same as above
Documentation
WIP