slack-blockx
TypeScript icon, indicating that this package has built-in type declarations

0.3.1 • Public • Published

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"
//           }
//         }
//       ]
//     }
//   ]
// }

View it on Block Kit Builder

Usage without compiler

const { jsx } = require('slack-blockx');
 
console.log(jsx`
  <blocks>
    <actions>
      <button>Button</button>
    </actions>
  </blocks>
`); // Same as above

View it on Block Kit Builder

Documentation

WIP

Readme

Keywords

none

Package Sidebar

Install

npm i slack-blockx

Weekly Downloads

3

Version

0.3.1

License

MIT

Unpacked Size

102 kB

Total Files

32

Last publish

Collaborators

  • kevin940726