// the find
raycharius/slack-block-builder
Lightweight Node.js library for building Slack Block Kit UIs, with a declarative syntax inspired by SwiftUI.
A TypeScript library that wraps Slack's Block Kit JSON API in a chainable builder pattern, so you write 15 lines of code instead of 44 lines of JSON. It covers the full Block Kit surface — modals, messages, home tabs — plus higher-level components for pagination and accordions. Aimed at anyone building non-trivial Slack bots who is tired of constructing nested JSON by hand.
Zero runtime dependencies, which matters for a library that lives inside every Slack bot you ship. The chainable API maps well to Block Kit's nested structure — reading a modal builder call tells you roughly what the rendered UI looks like, which raw JSON does not. The Paginator and Accordion components handle the fiddly part of those patterns (encoding state into actionIds, calculating offsets) so you don't have to. The printPreviewURL() method that drops a Block Kit Builder link into your console is a small thing that saves real time during development.
Last commit was August 2024 and the repo shows no recent activity, which means any Block Kit additions Slack ships are your problem to work around — you're not getting a wrapper update. Slack deprecated Workflow Steps in favor of their newer automation platform, but that surface is still in the library unchanged. The accordion and paginator components encode state as JSON in the actionId string, which hits Slack's 255-character actionId limit in non-trivial cases — the library doesn't warn you. There's also a copy-paste error in the README's reference table: URL Input is listed as Elements.NumberInput() instead of Elements.UrlInput(), which is a sign the docs aren't being actively maintained.