Skip to content

Conversation

@zimeg
Copy link
Member

@zimeg zimeg commented Nov 5, 2025

Summary

This PR adds the table block.

🔗 https://docs.slack.dev/reference/block-kit/blocks/table-block

Preview

The following code snippet can be used to post a table:

await app.client.chat.postMessage({
  channel: 'C0123456789',
  text: 'Numbers and letters',
  blocks: [
    {
      type: 'table',
      column_settings: [
        {
          is_wrapped: true,
        },
        {
          align: 'right',
        },
      ],
      rows: [
        [
          {
            type: 'rich_text',
            elements: [
              {
                type: 'rich_text_section',
                elements: [
                  {
                    text: 'Numbers',
                    type: 'link',
                    url: 'https://example.com/numbers',
                  },
                ],
              },
            ],
          },
          {
            type: 'rich_text',
            elements: [
              {
                type: 'rich_text_section',
                elements: [
                  {
                    text: 'Letters',
                    type: 'link',
                    url: 'https://example.com/letters',
                  },
                ],
              },
            ],
          },
        ],
        [
          {
            type: 'rich_text',
            elements: [
              {
                type: 'rich_text_section',
                elements: [
                  {
                    text: '1, 2, 3, 4, 5, ...',
                    type: 'text',
                  },
                ],
              },
            ],
          },
          {
            type: 'rich_text',
            elements: [
              {
                type: 'rich_text_section',
                elements: [
                  {
                    text: 'A, B, C, D, E, ...',
                    type: 'text',
                  },
                ],
              },
            ],
          },
        ],
      ],
    },
  ],
});

Notes

  • I'm not confident in the implementation with "raw_text" at this time and am checking with the team before request review!

Requirements

@zimeg zimeg added this to the [email protected] milestone Nov 5, 2025
@zimeg zimeg self-assigned this Nov 5, 2025
@zimeg zimeg added semver:minor enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` labels Nov 5, 2025
@codecov
Copy link

codecov bot commented Nov 5, 2025

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 93.02%. Comparing base (36c7f2a) to head (088a23e).
⚠️ Report is 1 commits behind head on main.
✅ All tests successful. No failed tests found.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2426      +/-   ##
==========================================
+ Coverage   92.71%   93.02%   +0.30%     
==========================================
  Files          22       40      +18     
  Lines        9474    11127    +1653     
  Branches      625      713      +88     
==========================================
+ Hits         8784    10351    +1567     
- Misses        678      764      +86     
  Partials       12       12              
Flag Coverage Δ
cli-hooks 95.23% <ø> (ø)
cli-test 94.79% <ø> (?)
oauth 77.39% <ø> (ø)
socket-mode 61.87% <ø> (ø)
web-api 98.08% <ø> (ø)
webhook 96.66% <ø> (ø)

Flags with carried forward coverage won't be shown. Click here to find out more.

🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

Copy link
Member Author

@zimeg zimeg left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🐦 A note for reviewers after most recent testing!


/**
* @description Defines an object containing some text.
* @see {@link https://docs.slack.dev/reference/block-kit/composition-objects/text-object Text object reference}.
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

📝 note: This is undocumented as a text object at this time. I've sent a message related to this but believe this is the correct place for the raw_text reference and implementation!

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet 💯

@zimeg zimeg marked this pull request as ready for review November 18, 2025 01:26
@zimeg zimeg requested a review from a team as a code owner November 18, 2025 01:26

/**
* @description Defines an object containing some text.
* @see {@link https://docs.slack.dev/reference/block-kit/composition-objects/text-object Text object reference}.
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sweet 💯

* @description Displays structured information in a table.
* @see {@link https://docs.slack.dev/reference/block-kit/blocks/table-block Table block reference}.
*/
export interface TableBlock extends Block {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Praise!

@zimeg
Copy link
Member Author

zimeg commented Nov 19, 2025

@WilliamBergamin I share excitement for this new block. With expected results appearing on the server side I'll merge this next! 🧱 ✨

@zimeg zimeg merged commit 90ed66e into main Nov 19, 2025
57 checks passed
@zimeg zimeg deleted the zimeg-feat-types-table-block branch November 19, 2025 18:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement M-T: A feature request for new functionality pkg:types applies to `@slack/types` semver:minor

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants