8000 Support for passing a id via props · Issue #888 · material-table-core/core · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

Support for passing a id via props #888

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
dbollingerlawcode opened this issue May 20, 2025 · 0 comments
Open

Support for passing a id via props #888

dbollingerlawcode opened this issue May 20, 2025 · 0 comments

Comments

@dbollingerlawcode
Copy link
dbollingerlawcode commented May 20, 2025

Currently, it seems there is no way to directly assign an id to the underlying table element.

This feature would be helpful in scenarios like end-to-end testing with tools such as Selenium or Playwright, where selecting elements by ID is often more stable and precise than relying on class names or wrapper elements.

While it's possible to wrap the MaterialTable component in a custom container and assign an ID to that, it would be much more robust and direct to have the ability to pass an id prop (or similar) to the table itself.

Is this currently planned or am I just not seeing how it works?

Use Case Example:

<MaterialTable
  id="user-data-table"
  ...
  columns={...}
  data={...}
/>
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

No branches or pull requests

1 participant
0