Skip to content

feat: export table action components and utilities#421

Open
estevaolucas wants to merge 1 commit intovercel:mainfrom
estevaolucas:feat/export-table-components
Open

feat: export table action components and utilities#421
estevaolucas wants to merge 1 commit intovercel:mainfrom
estevaolucas:feat/export-table-components

Conversation

@estevaolucas
Copy link

@estevaolucas estevaolucas commented Feb 25, 2026

Closes #422

Summary

When overriding streamdown's table component with custom React components, the built-in copy/download buttons are lost because custom components fully replace default implementations. The table action components (TableCopyDropdown, TableDownloadDropdown) and their utilities are internal — not exported from the public API.

This PR adds exports to the main entry point so consumers can import these components and wire them into custom table overrides.

Changes

  • Export table components from packages/streamdown/index.tsx: TableCopyDropdown, TableDownloadButton, TableDownloadDropdown with their prop types
  • Export table utilities: extractTableDataFromElement, tableDataToCSV, tableDataToTSV, tableDataToMarkdown, escapeMarkdownTableCell, TableData
  • Fix icon type error: Replace size={14} with width={14} height={14} on SVG icons in table components (pre-existing type issue exposed by new exports)
  • Add documentation section in components.mdx explaining how to preserve table interactivity with custom overrides
  • Add changeset for minor version bump

Test Plan

  • pnpm build — streamdown package builds successfully with new exports
  • pnpm test — all 792 tests pass (59 test files)
  • pnpm check — linting/formatting passes
  • Generated dist/index.d.ts includes all new type exports

Export TableCopyDropdown, TableDownloadButton, TableDownloadDropdown,
and table utility functions (extractTableDataFromElement, tableDataToCSV,
tableDataToTSV, tableDataToMarkdown, escapeMarkdownTableCell, TableData)
from the main entry point, enabling custom table overrides to preserve
copy/download interactivity.

Also fixes a type error in table components where `size` prop was passed
to SVG icons that only accept standard SVG attributes (width/height).

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
@vercel
Copy link
Contributor

vercel bot commented Feb 25, 2026

@estevaolucas is attempting to deploy a commit to the Vercel Team on Vercel.

A member of the Team first needs to authorize it.

@estevaolucas estevaolucas marked this pull request as ready for review February 25, 2026 20:23
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.

Table action components not exported for custom table overrides

1 participant