Slack Block Kit Rich Text Input Composer Prompt
Capture and round-trip formatted user input using the rich_text_input block and rich_text element trees
- Target user
- engineers building Slack ChatOps and bots
- Difficulty
- Intermediate
- Tools
- Claude, ChatGPT
The prompt
You are a senior platform engineer who builds Slack apps and designs modals that capture richly formatted text such as incident notes and runbook steps. I will provide: - The form where rich input is needed (e.g. modal, App Home) and what the formatted text feeds into - The downstream storage/render target (DB, ticket system, re-posted message) - Constraints on allowed formatting and length Your job: 1. **Element setup** — define the `rich_text_input` block with sensible `dispatch_action` and placeholder config, and explain how it differs from a plain_text_input. 2. **Parsing the submission** — show how to read the `rich_text` value from the view-submission payload and walk its nested element tree (sections, lists, quotes, code, links, mentions). 3. **Normalization** — convert the rich_text tree into your downstream format (e.g. mrkdwn, Markdown, or HTML), handling user mentions, links, and code blocks safely. 4. **Round-trip rendering** — show how to re-emit stored content back into a `rich_text` block so edits preserve formatting. 5. **Validation and sanitization** — enforce length and allowed-element rules, and escape/strip anything unsafe before it reaches the downstream system. 6. **Edge cases** — handle empty input, deeply nested lists, broken mentions, and unsupported elements without losing data. 7. **Test plan** — provide sample payloads covering each formatting element and the expected normalized output. Output as: an annotated example rich_text submission payload, the tree-walking parser pseudocode, and a normalization mapping table (element -> downstream output). Sanitize converted output before it leaves Slack; rich_text can carry links and mentions that must not become injection vectors downstream.
Run this prompt with AI
Test it, get an AI-improved version, or compare models — live in the Prompt Workspace. No copy-paste.
Related prompts
-
Slack Block Kit Modal Input Validation & Error Display Prompt
Design server-side validation for Block Kit modals — response_action errors, per-input error keying, cross-field rules, and re-render UX that never loses user input.
-
Slack Live Progress Bar with chat.update Prompt
Render a single self-updating Slack message that shows live progress for a long-running deploy or job, using chat.update against a stored ts instead of spamming the channel with per-step posts.
-
Slack Block Kit Date & Time Picker Constraints Prompt
Design Block Kit datepicker/timepicker/datetimepicker inputs with min/max bounds, timezone handling, and validation for ops scheduling forms.
-
Slack Modal View Stack Multi-Step Navigation Prompt
Design a multi-step Slack modal flow using views.push, views.update, and the view stack so ops forms can branch, go back, and carry state without losing user input.
More Slack prompts & error guides
Browse every Slack prompt and troubleshooting guide in one place.
Reading prompts? Get all 500 in one free PDF
500 battle-tested, copy-paste AI prompts engineered by a senior systems engineer — every one with fill-in placeholders and safety/back-out notes. Drop your email and it's yours.
- 500 prompts: Linux · Kubernetes · Terraform · OpenStack · GitLab · Docker · Monitoring · Incident Response
- Instant PDF download — yours free, forever
- Plus one practical AI-workflow email a week (no spam)
Single opt-in · unsubscribe anytime · no spam.