Skip to content

fix(table): column props not recognized#5950

Merged
wingkwong merged 3 commits into
canaryfrom
fix/issue-1667
Dec 4, 2025
Merged

fix(table): column props not recognized#5950
wingkwong merged 3 commits into
canaryfrom
fix/issue-1667

Conversation

@wingkwong
Copy link
Copy Markdown
Member

@wingkwong wingkwong commented Nov 29, 2025

Closes #

📝 Description

⛳️ Current behavior (updates)

🚀 New behavior

💣 Is this a breaking change (Yes/No):

📝 Additional Information

Summary by CodeRabbit

  • Bug Fixes

    • Fixed an issue where column properties were not being recognized.
  • New Features

    • Added support for width, minWidth, and maxWidth CSS properties on table columns.
  • Documentation

    • Updated example code to reflect simplified component structure.

✏️ Tip: You can customize this high-level summary in your review settings.

@wingkwong wingkwong added this to the v2.8.6 milestone Nov 29, 2025
@vercel
Copy link
Copy Markdown

vercel Bot commented Nov 29, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
heroui Ready Ready Preview Comment Nov 29, 2025 5:22pm
heroui-sb Ready Ready Preview Comment Nov 29, 2025 5:22pm

@changeset-bot
Copy link
Copy Markdown

changeset-bot Bot commented Nov 29, 2025

🦋 Changeset detected

Latest commit: 36e4d1e

The changes in this PR will be included in the next version bump.

This PR includes changesets to release 2 packages
Name Type
@heroui/table Patch
@heroui/react Patch

Not sure what this means? Click here to learn what changesets are.

Click here if you're a maintainer who wants to add another changeset to this PR

@coderabbitai
Copy link
Copy Markdown
Contributor

coderabbitai Bot commented Nov 29, 2025

Walkthrough

This PR addresses a bug in table column prop recognition (#1667) by removing unnecessary wrapper divs around Dropdown components in documentation examples and adds support for width-related CSS properties (width, minWidth, maxWidth) to the table column header component with automatic pixel unit normalization.

Changes

Cohort / File(s) Summary
Changeset
.changeset/fair-years-shave.md
Patch version bump for @heroui/table with bug fix for column props recognition
Documentation Examples
apps/docs/app/examples/table/custom-styles/page.tsx, apps/docs/app/examples/table/use-case/page.tsx
Removed outer wrapper divs from Dropdown components in ACTIONS cell rendering
Documentation Raw Content
apps/docs/content/components/table/custom-styles.raw.jsx, apps/docs/content/components/table/custom-styles.raw.tsx, apps/docs/content/components/table/use-case.raw.jsx, apps/docs/content/components/table/use-case.raw.tsx
Removed wrapper divs with flex alignment classes around Dropdown elements in actions cell renderers
Table Column Header Component
packages/components/table/src/table-column-header.tsx
Added normalizeWidth helper to convert numeric widths to pixel strings; extended component to read and apply width, minWidth, and maxWidth props from node.props to the rendered header element

Estimated code review effort

🎯 2 (Simple) | ⏱️ ~10 minutes

  • Most changes follow a consistent, repetitive pattern (wrapper div removal across documentation files)
  • Component enhancement is straightforward property addition with simple normalization logic
  • No complex control flow or business logic to validate

Suggested reviewers

  • jrgarciadev

Pre-merge checks and finishing touches

❌ Failed checks (2 warnings)
Check name Status Explanation Resolution
Description check ⚠️ Warning The PR description uses only the template structure with all placeholders unfilled, providing no actual context, issue reference, or behavioral details about the changes. Fill in all template sections: reference issue #1667, describe how column props were previously ignored, explain the normalizeWidth helper solution, and confirm this is not a breaking change.
Docstring Coverage ⚠️ Warning Docstring coverage is 0.00% which is insufficient. The required threshold is 80.00%. You can run @coderabbitai generate docstrings to improve docstring coverage.
✅ Passed checks (1 passed)
Check name Status Explanation
Title check ✅ Passed The title accurately describes the main fix: column width props (width, minWidth, maxWidth) are now recognized and applied in the table column header component.
✨ Finishing touches
  • 📝 Generate docstrings
🧪 Generate unit tests (beta)
  • Create PR with unit tests
  • Post copyable unit tests in a comment
  • Commit unit tests in branch fix/issue-1667

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands and usage tips.

Copy link
Copy Markdown
Contributor

@coderabbitai coderabbitai Bot left a comment

Choose a reason for hiding this comment

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

Actionable comments posted: 0

🧹 Nitpick comments (2)
apps/docs/app/examples/table/use-case/page.tsx (1)

345-356: LGTM! DOM structure simplification looks good.

The removal of the wrapper div around the Dropdown is a clean simplification that reduces unnecessary DOM nesting while preserving all functionality.

Consider adding an example that demonstrates the actual bug fix (column width props) to help users understand what was fixed. For instance, you could add width props to one of the TableColumn components:

<TableColumn
  key={column.uid}
  align={column.uid === "actions" ? "center" : "start"}
  allowsSorting={column.sortable}
  width={column.uid === "actions" ? 100 : undefined}
>
  {column.name}
</TableColumn>
packages/components/table/src/table-column-header.tsx (1)

56-64: Core bug fix looks good - column width props now properly recognized.

This correctly addresses issue #1667 by:

  1. Extracting width, minWidth, and maxWidth from node.props
  2. Building a columnStyles object using the normalized values
  3. Conditionally adding only the props that are provided

The implementation properly handles both numeric and string width values through the normalizeWidth helper.

For additional type safety, consider adding explicit typing for the width-related props in the node.props interface to ensure only valid CSS width values are accepted. This would catch issues at compile time rather than runtime.

📜 Review details

Configuration used: Path: .coderabbit.yaml

Review profile: CHILL

Plan: Pro

📥 Commits

Reviewing files that changed from the base of the PR and between 66ef76e and 36e4d1e.

📒 Files selected for processing (8)
  • .changeset/fair-years-shave.md (1 hunks)
  • apps/docs/app/examples/table/custom-styles/page.tsx (1 hunks)
  • apps/docs/app/examples/table/use-case/page.tsx (1 hunks)
  • apps/docs/content/components/table/custom-styles.raw.jsx (1 hunks)
  • apps/docs/content/components/table/custom-styles.raw.tsx (1 hunks)
  • apps/docs/content/components/table/use-case.raw.jsx (1 hunks)
  • apps/docs/content/components/table/use-case.raw.tsx (1 hunks)
  • packages/components/table/src/table-column-header.tsx (3 hunks)
🧰 Additional context used
🧬 Code graph analysis (3)
apps/docs/content/components/table/use-case.raw.tsx (3)
packages/components/dropdown/src/index.ts (3)
  • Dropdown (21-21)
  • DropdownTrigger (22-22)
  • DropdownMenu (23-23)
apps/docs/content/components/table/custom-styles.raw.jsx (2)
  • VerticalDotsIcon (269-287)
  • VerticalDotsIcon (269-287)
apps/docs/content/components/table/use-case.raw.jsx (2)
  • VerticalDotsIcon (269-287)
  • VerticalDotsIcon (269-287)
apps/docs/content/components/table/custom-styles.raw.jsx (3)
packages/components/dropdown/src/index.ts (3)
  • Dropdown (21-21)
  • DropdownTrigger (22-22)
  • DropdownMenu (23-23)
apps/docs/content/components/table/use-case.raw.jsx (2)
  • VerticalDotsIcon (269-287)
  • VerticalDotsIcon (269-287)
apps/docs/content/components/table/use-case.raw.tsx (1)
  • VerticalDotsIcon (57-75)
apps/docs/app/examples/table/custom-styles/page.tsx (1)
packages/components/dropdown/src/index.ts (3)
  • Dropdown (21-21)
  • DropdownTrigger (22-22)
  • DropdownMenu (23-23)
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (4)
  • GitHub Check: Continuous Release
  • GitHub Check: TypeScript
  • GitHub Check: ESLint
  • GitHub Check: Build
🔇 Additional comments (8)
.changeset/fair-years-shave.md (1)

1-5: LGTM! Changeset properly documents the patch release.

The changeset correctly documents this as a patch-level fix for the table component with appropriate reference to issue #1667.

apps/docs/app/examples/table/custom-styles/page.tsx (1)

353-364: LGTM! Consistent DOM simplification.

This change maintains consistency with the other documentation examples by removing the unnecessary wrapper div around the Dropdown component.

apps/docs/content/components/table/use-case.raw.jsx (1)

436-447: LGTM! Consistent simplification in JSX variant.

The change maintains consistency across all documentation variants (JSX and TSX) by applying the same DOM simplification pattern.

apps/docs/content/components/table/custom-styles.raw.tsx (1)

456-467: LGTM! Consistent across all documentation files.

The Dropdown simplification is applied consistently across all documentation variants.

apps/docs/content/components/table/custom-styles.raw.jsx (1)

444-455: LGTM! Final documentation variant updated consistently.

All documentation files now follow the same simplified Dropdown structure pattern.

apps/docs/content/components/table/use-case.raw.tsx (1)

449-460: LGTM! Documentation changes complete.

This completes the consistent application of the Dropdown simplification pattern across all documentation examples.

packages/components/table/src/table-column-header.tsx (2)

38-40: LGTM! Clean utility function for width normalization.

The normalizeWidth helper correctly converts numeric values to pixel strings while preserving string values as-is, enabling flexible width specifications.


85-85: Proper application of computed column styles.

The columnStyles object is correctly applied to the rendered component via the style prop, ensuring the width-related properties are respected in the DOM.

@pkg-pr-new
Copy link
Copy Markdown

pkg-pr-new Bot commented Nov 29, 2025

Open in StackBlitz

@heroui/accordion

npm i https://pkg.pr.new/@heroui/accordion@5950

@heroui/alert

npm i https://pkg.pr.new/@heroui/alert@5950

@heroui/autocomplete

npm i https://pkg.pr.new/@heroui/autocomplete@5950

@heroui/avatar

npm i https://pkg.pr.new/@heroui/avatar@5950

@heroui/badge

npm i https://pkg.pr.new/@heroui/badge@5950

@heroui/breadcrumbs

npm i https://pkg.pr.new/@heroui/breadcrumbs@5950

@heroui/button

npm i https://pkg.pr.new/@heroui/button@5950

@heroui/calendar

npm i https://pkg.pr.new/@heroui/calendar@5950

@heroui/card

npm i https://pkg.pr.new/@heroui/card@5950

@heroui/checkbox

npm i https://pkg.pr.new/@heroui/checkbox@5950

@heroui/chip

npm i https://pkg.pr.new/@heroui/chip@5950

@heroui/code

npm i https://pkg.pr.new/@heroui/code@5950

@heroui/date-input

npm i https://pkg.pr.new/@heroui/date-input@5950

@heroui/date-picker

npm i https://pkg.pr.new/@heroui/date-picker@5950

@heroui/divider

npm i https://pkg.pr.new/@heroui/divider@5950

@heroui/drawer

npm i https://pkg.pr.new/@heroui/drawer@5950

@heroui/dropdown

npm i https://pkg.pr.new/@heroui/dropdown@5950

@heroui/form

npm i https://pkg.pr.new/@heroui/form@5950

@heroui/image

npm i https://pkg.pr.new/@heroui/image@5950

@heroui/input

npm i https://pkg.pr.new/@heroui/input@5950

@heroui/input-otp

npm i https://pkg.pr.new/@heroui/input-otp@5950

@heroui/kbd

npm i https://pkg.pr.new/@heroui/kbd@5950

@heroui/link

npm i https://pkg.pr.new/@heroui/link@5950

@heroui/listbox

npm i https://pkg.pr.new/@heroui/listbox@5950

@heroui/menu

npm i https://pkg.pr.new/@heroui/menu@5950

@heroui/modal

npm i https://pkg.pr.new/@heroui/modal@5950

@heroui/navbar

npm i https://pkg.pr.new/@heroui/navbar@5950

@heroui/number-input

npm i https://pkg.pr.new/@heroui/number-input@5950

@heroui/pagination

npm i https://pkg.pr.new/@heroui/pagination@5950

@heroui/popover

npm i https://pkg.pr.new/@heroui/popover@5950

@heroui/progress

npm i https://pkg.pr.new/@heroui/progress@5950

@heroui/radio

npm i https://pkg.pr.new/@heroui/radio@5950

@heroui/ripple

npm i https://pkg.pr.new/@heroui/ripple@5950

@heroui/scroll-shadow

npm i https://pkg.pr.new/@heroui/scroll-shadow@5950

@heroui/select

npm i https://pkg.pr.new/@heroui/select@5950

@heroui/skeleton

npm i https://pkg.pr.new/@heroui/skeleton@5950

@heroui/slider

npm i https://pkg.pr.new/@heroui/slider@5950

@heroui/snippet

npm i https://pkg.pr.new/@heroui/snippet@5950

@heroui/spacer

npm i https://pkg.pr.new/@heroui/spacer@5950

@heroui/spinner

npm i https://pkg.pr.new/@heroui/spinner@5950

@heroui/switch

npm i https://pkg.pr.new/@heroui/switch@5950

@heroui/table

npm i https://pkg.pr.new/@heroui/table@5950

@heroui/tabs

npm i https://pkg.pr.new/@heroui/tabs@5950

@heroui/toast

npm i https://pkg.pr.new/@heroui/toast@5950

@heroui/tooltip

npm i https://pkg.pr.new/@heroui/tooltip@5950

@heroui/user

npm i https://pkg.pr.new/@heroui/user@5950

@heroui/react

npm i https://pkg.pr.new/@heroui/react@5950

@heroui/system

npm i https://pkg.pr.new/@heroui/system@5950

@heroui/system-rsc

npm i https://pkg.pr.new/@heroui/system-rsc@5950

@heroui/theme

npm i https://pkg.pr.new/@heroui/theme@5950

@heroui/use-aria-accordion

npm i https://pkg.pr.new/@heroui/use-aria-accordion@5950

@heroui/use-aria-accordion-item

npm i https://pkg.pr.new/@heroui/use-aria-accordion-item@5950

@heroui/use-aria-button

npm i https://pkg.pr.new/@heroui/use-aria-button@5950

@heroui/use-aria-link

npm i https://pkg.pr.new/@heroui/use-aria-link@5950

@heroui/use-aria-modal-overlay

npm i https://pkg.pr.new/@heroui/use-aria-modal-overlay@5950

@heroui/use-aria-multiselect

npm i https://pkg.pr.new/@heroui/use-aria-multiselect@5950

@heroui/use-aria-overlay

npm i https://pkg.pr.new/@heroui/use-aria-overlay@5950

@heroui/use-callback-ref

npm i https://pkg.pr.new/@heroui/use-callback-ref@5950

@heroui/use-clipboard

npm i https://pkg.pr.new/@heroui/use-clipboard@5950

@heroui/use-data-scroll-overflow

npm i https://pkg.pr.new/@heroui/use-data-scroll-overflow@5950

@heroui/use-disclosure

npm i https://pkg.pr.new/@heroui/use-disclosure@5950

@heroui/use-draggable

npm i https://pkg.pr.new/@heroui/use-draggable@5950

@heroui/use-form-reset

npm i https://pkg.pr.new/@heroui/use-form-reset@5950

@heroui/use-image

npm i https://pkg.pr.new/@heroui/use-image@5950

@heroui/use-infinite-scroll

npm i https://pkg.pr.new/@heroui/use-infinite-scroll@5950

@heroui/use-intersection-observer

npm i https://pkg.pr.new/@heroui/use-intersection-observer@5950

@heroui/use-is-mobile

npm i https://pkg.pr.new/@heroui/use-is-mobile@5950

@heroui/use-is-mounted

npm i https://pkg.pr.new/@heroui/use-is-mounted@5950

@heroui/use-measure

npm i https://pkg.pr.new/@heroui/use-measure@5950

@heroui/use-pagination

npm i https://pkg.pr.new/@heroui/use-pagination@5950

@heroui/use-real-shape

npm i https://pkg.pr.new/@heroui/use-real-shape@5950

@heroui/use-ref-state

npm i https://pkg.pr.new/@heroui/use-ref-state@5950

@heroui/use-resize

npm i https://pkg.pr.new/@heroui/use-resize@5950

@heroui/use-safe-layout-effect

npm i https://pkg.pr.new/@heroui/use-safe-layout-effect@5950

@heroui/use-scroll-position

npm i https://pkg.pr.new/@heroui/use-scroll-position@5950

@heroui/use-ssr

npm i https://pkg.pr.new/@heroui/use-ssr@5950

@heroui/use-theme

npm i https://pkg.pr.new/@heroui/use-theme@5950

@heroui/use-update-effect

npm i https://pkg.pr.new/@heroui/use-update-effect@5950

@heroui/use-viewport-size

npm i https://pkg.pr.new/@heroui/use-viewport-size@5950

@heroui/aria-utils

npm i https://pkg.pr.new/@heroui/aria-utils@5950

@heroui/dom-animation

npm i https://pkg.pr.new/@heroui/dom-animation@5950

@heroui/framer-utils

npm i https://pkg.pr.new/@heroui/framer-utils@5950

@heroui/react-rsc-utils

npm i https://pkg.pr.new/@heroui/react-rsc-utils@5950

@heroui/react-utils

npm i https://pkg.pr.new/@heroui/react-utils@5950

@heroui/shared-icons

npm i https://pkg.pr.new/@heroui/shared-icons@5950

@heroui/shared-utils

npm i https://pkg.pr.new/@heroui/shared-utils@5950

@heroui/stories-utils

npm i https://pkg.pr.new/@heroui/stories-utils@5950

@heroui/test-utils

npm i https://pkg.pr.new/@heroui/test-utils@5950

commit: 36e4d1e

@wingkwong wingkwong merged commit f08dfb8 into canary Dec 4, 2025
10 checks passed
@wingkwong wingkwong deleted the fix/issue-1667 branch December 4, 2025 13:42
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