Skip to content

feat(block-kit): add card block example#116

Draft
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-card-example
Draft

feat(block-kit): add card block example#116
zimeg wants to merge 1 commit into
mainfrom
feat/block-kit-card-example

Conversation

@zimeg

@zimeg zimeg commented Jun 26, 2026

Copy link
Copy Markdown
Member

Summary

Adds a Block Kit card block example to the block-kit examples package, mirroring the official docs example.

  • example01() — a full card with icon, title, subtitle, hero_image, body, and an actions button (matches the docs JSON verbatim).
  • example02() — a minimal card with only title + actions, illustrating that at least one of hero_image, title, actions, or body is required.

Each example is typed against @slack/types CardBlock via JSDoc, with a matching node:test deep-equal test and a new alphabetized README entry.

Docs: https://docs.slack.dev/reference/block-kit/blocks/card-block

Validation

Run in block-kit/ (deps installed via npm install --no-save @slack/types typescript @types/node since the pinned @biomejs/biome devDep was unavailable in this environment):

  • node --test → 34 tests pass, 0 fail (includes the 2 new card tests).
  • npx tsc --checkJs --noEmit --types node src/blocks/card.js tests/blocks/card.test.js → exit 0 (no type errors).

Note: @slack/types@2.20.1 (the resolved version) does not yet expose the slack_icon / subtext / block_id card fields beyond the base Block, so the examples use the currently-typed fields.

This is a draft — one block per PR. Not marking ready for review.

Co-Authored-By: Claude svc-devxp-claude@slack-corp.com

Add a Block Kit card block example to the block-kit examples package,
mirroring the official docs example. Includes a full card (icon, title,
subtitle, hero image, body, action button) and a minimal title+actions
variant, a matching deep-equal test, and a README entry.

Docs: https://docs.slack.dev/reference/block-kit/blocks/card-block

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant