Exported types

All types ship from the package entry. Payload shapes extend Slack's official @slack/types definitions, so payloads typed for the Slack SDK type-check against the renderer without conversion.

Payloads

TypeShape
BlockKitInputEverything <BlockKit /> accepts: BlockKitData, a JSON string, or unvalidated arrays/objects
BlockKitDatareadonly RenderableBlock[] | BlockKitPayload; the validated form returned by parseBlockKitData
BlockKitPayload{ readonly blocks: readonly RenderableBlock[] }
RenderableBlockUnion of every supported block type
BlockKitSurface"message" | "modal" | "home"
BlockKitTheme"light" | "dark"

Use satisfies to keep literal payloads checked while preserving their inferred shape:

import type { BlockKitData } from "react-blockkit";

export const payload = {
  blocks: [{ type: "section", text: { type: "mrkdwn", text: "Typed end to end." } }],
} satisfies BlockKitData;

Per-block data types

Every block type has a corresponding …Data type, the exact shape its component accepts: ActionsBlockData, AlertBlockData, CardBlockData, CarouselBlockData, ContainerBlockData, ContextBlockData, ContextActionsBlockData, DataTableBlockData, DataVisualizationBlockData, DividerBlockData, FileBlockData, HeaderBlockData, ImageBlockData, InputBlockData, MarkdownBlockData, PlanBlockData, RichTextBlockData, SectionBlockData, TableBlockData, TaskCardBlockData, and VideoBlockData.

Element and text-object shapes follow the same pattern: ButtonElementData, ImageElementData, InteractiveElementData, OptionData, and TextObjectData. All of these are deeply readonly.

Interactions and resolvers

TypeShape
BlockKitAction{ actionId, type, blockId?, value?, values? }; see Handling actions
BlockKitResolversOptional user, channel, usergroup, team, emoji, and date functions; see Resolvers and mentions

Errors and tokens

TypeShape
BlockKitInvariantCodeUnion of the stable error codes listed in the validation reference
BlockKitInvariantDetails{ code, path }; the constructor details for BlockKitInvariantError
MrkdwnTokenDiscriminated union produced by tokenizeMrkdwn

Component props

Each component exports its props interface: BlockKitProps, BlockKitProviderProps, BlockProps, ButtonElementProps, ImageElementProps, InputElementProps, InteractiveElementProps, OverflowElementProps, SelectElementProps, TableCellProps, MarkdownProps, MrkdwnProps, RichTextProps, and TextProps.

Re-exports from @slack/types

For convenience, commonly used SDK types are re-exported unchanged: ActionsBlock, AlertBlock, Button, Checkboxes, ContextActionsBlock, ContextBlock, DividerBlock, FileBlock, ImageBlock, ImageElement, InputBlock, MarkdownBlock, Option, PlainTextElement, PlanBlock, RichTextElement, SectionBlock, TaskCardBlock, TextObject, and VideoBlock.