0.2.0 • Published 9 years ago
slack-jsx v0.2.0
slack-jsx
Nested JSON is hard to grasp on first sight. Use familiar JSX component syntax to compose Slack messages instead.
Install
npm install slack-jsxUsage
/** @jsx Slack */
import Slack from 'slack-jsx'
import { Message, Attachment } from 'slack-jsx/components'
<Message text='I am a test message' />
<Message>
<Attachment pretext='Above the attachment' />
</MessageAPI
pragma(node, props, ...children)
Compiles a Slack message from slack-jsx components.
- returns: Slack JSON message string
node- aslack-jsxcompatible componentprops- any valid combination of Slack message propschildren- an Array of sub-components with following behavior:- first child - if Array, it gets flattened into children
- rest - not flattened in any case
Contributing
Pull requests and stars are always welcome. For bugs and feature requests, please create an issue. But before doing anything, please read the CONTRIBUTING.md guidelines.