Slack Block Kit messages, rendered in React.

@nkootstra/block-kit takes the Block Kit JSON your Slack app sends and draws the message, modal or Home tab the way Slack does, with the same spacing, fonts and colours. Buttons and menus work, and hand you the payloads Slack would.

Block Kit Builder only runs inside Slack. This is for everywhere else: an admin panel, a template gallery, an approval queue, a test harness for your bot.

$ npm install @nkootstra/block-kit @fontsource/lato @fontsource/roboto-monopnpm add @nkootstra/block-kit @fontsource/lato @fontsource/roboto-monoyarn add @nkootstra/block-kit @fontsource/lato @fontsource/roboto-monobun add @nkootstra/block-kit @fontsource/lato @fontsource/roboto-mono

Read the quickstart Add the stylesheet, render a message, handle a click.

Try it in the Block Kit playground Paste your JSON and see it rendered. No install, no sign-in.

Deploy botAPP
Releasing v0.14.0 of the web app.
A plan block updating as its tasks finish, rendered live by block-kit.

Buttons that work

Buttons, menus, pickers and inputs work. onPayload receives the block_actions payload Slack would send your app, and a signed relay can forward it to your Bolt app.

Time OffAPP
Ada Lovelace requested time off :palm_tree:
Type:
Paid time off
When:
Aug 10 – Aug 13

onPayloadClick Approve or Deny.

Check it against Slack

Each block is checked, pixel by pixel, against a capture of Slack's own rendering. This one matches in all of its 684,032 pixels, in Slack's light theme and its dark one. Drag across it, or show the difference.

Slack's own rendering of a device request approval message, in its light theme
The same message rendered by block-kit
Slack's own rendering of a device request approval message, in its dark theme
The same message rendered by block-kit

Captured in Slack's light theme.Captured in Slack's dark theme.

Blocks

Each one links to its docs page and live examples, including the newer agent blocks such as plan and task_card.

Render your first message and handle a click: read the quickstart.