Skip to content

[Doc] Add <DataTable hiddenColumns> documentation#10800

Merged
fzaninotto merged 1 commit intomasterfrom
docs-datatable-hiddencolumns
Jun 24, 2025
Merged

[Doc] Add <DataTable hiddenColumns> documentation#10800
fzaninotto merged 1 commit intomasterfrom
docs-datatable-hiddencolumns

Conversation

@Madeorsk
Copy link
Copy Markdown
Contributor

Problem

We mention and link the prop hiddenColumns but we didn’t write anything about it.

Solution

Write a section of the DataTable on the hiddenColumns prop.

Additional Checks

  • The PR targets master for a bugfix or a documentation fix, or next for a feature
  • [ ] The PR includes unit tests (if not possible, describe why)
  • [ ] The PR includes one or several stories (if not possible, describe why)
  • The documentation is up to date

@Madeorsk Madeorsk added the RFR Ready For Review label Jun 24, 2025
@fzaninotto fzaninotto changed the title Add docs about hiddenColumns property of <DataTable> Add docs about <DataTable hiddenColumns> Jun 24, 2025
Comment thread docs/DataTable.md Outdated
);
```

## `hiddenColumns`
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

please place this section in alphabetical order with other props.

Comment thread docs/DataTable.md Outdated

By default, `<DataTable>` renders all `<DataTable.Col>` children. Use the `hiddenColumns` property to set hidden columns by default.

Using the `hiddenColumns` property instead of removing `<DataTable.Col>` elements entirely allows hidden columns to be displayed again using a `ColumnsButton`, as in [Hiding or Reordering](#hiding-or-reordering-columns) section.
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

Suggested change
Using the `hiddenColumns` property instead of removing `<DataTable.Col>` elements entirely allows hidden columns to be displayed again using a `ColumnsButton`, as in [Hiding or Reordering](#hiding-or-reordering-columns) section.
Using the `hiddenColumns` instead of removing `<DataTable.Col>` elements allows hidden columns to be displayed again using a `<ColumnsButton>`, as explained in the [Hiding or Reordering Columns](#hiding-or-reordering-columns) section.

Comment thread docs/DataTable.md Outdated

```tsx
const PostList = () => (
<List actions={<PostListActions />}>
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd show the PostListActions with its ColumnsButton, otherwise the example falls short.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

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

I did it, but wouldn't it be better to keep this example minimal to only demonstrate the documented property?
I'd remove entirely, as the documentation about Hiding or Reordering Columns already documents this.

Comment thread docs/DataTable.md Outdated

Using the `hiddenColumns` property instead of removing `<DataTable.Col>` elements entirely allows hidden columns to be displayed again using a `ColumnsButton`, as in [Hiding or Reordering](#hiding-or-reordering-columns) section.

```tsx
Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

I'd put this code snippet right after the first sentence, "by default..."

@fzaninotto fzaninotto merged commit cfbfb1d into master Jun 24, 2025
15 checks passed
@fzaninotto fzaninotto deleted the docs-datatable-hiddencolumns branch June 24, 2025 13:42
@fzaninotto fzaninotto added this to the 5.9.1 milestone Jun 24, 2025
@fzaninotto fzaninotto changed the title Add docs about <DataTable hiddenColumns> [Doc] Add <DataTable hiddenColumns> documentation Jul 1, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

RFR Ready For Review

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants