Skip to content

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

Merged
zimeg merged 5 commits into
mainfrom
feat/block-kit-card-example
Aug 1, 2026
Merged

feat(block-kit): add card block example#116
zimeg merged 5 commits 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

zimeg and others added 3 commits June 26, 2026 16:55
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>
Use 'Displays content in a card.' in the README entry and the card.js
JSDoc, replacing the mismatched README/JSDoc wording with a single
consistent one-liner.

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg zimeg added enhancement New feature or request javascript Pull requests that update javascript code labels Aug 1, 2026
@zimeg zimeg self-assigned this Aug 1, 2026
zimeg and others added 2 commits July 31, 2026 17:59
Drop example02 (minimal card) so the card example matches the single
example on the card block reference page (docs.slack.dev). example01 is
the full card (icon, title, subtitle, hero image, body, actions).

Co-Authored-By: Claude <svc-devxp-claude@slack-corp.com>
@zimeg
zimeg marked this pull request as ready for review August 1, 2026 01:06
@zimeg
zimeg requested a review from a team as a code owner August 1, 2026 01:06
@zimeg
zimeg merged commit f19b53b into main Aug 1, 2026
6 checks passed
@zimeg
zimeg deleted the feat/block-kit-card-example branch August 1, 2026 01:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request javascript Pull requests that update javascript code

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant