Click to Copy Feature Guide
Mantine React Table has an easy-to-implement feature that allows a user to copy a cell's value to the clipboard.
Relevant Table Options
# | Prop Name | Type | Default Value | More Info Links | |
---|---|---|---|---|---|
1 | boolean | false | MRT Click to Copy Docs | ||
2 | UnstyledButtonProps | ({ cell, column, row, table }) => UnstyledButtonProps |
| Mantine UnstyledButton Docs | ||
Relevant Column Options
# | Column Option | Type | Default Value | More Info Links | |
---|---|---|---|---|---|
1 | boolean |
| MRT Click to Copy Docs | ||
2 | UnstyledButtonProps | ({ cell, column, row, table }) => UnstyledButtonProps |
| Mantine UnstyledButton API | ||
Enable Click to Copy Per Column
Most likely, there will just be a couple columns that you want to enable click to copy for. You can do this by setting the enableClickToCopy
option to true
per column on the column definition.
Enable Click to Copy For All Cells
Alternatively, you can enable click to copy globally by setting the enableClickToCopy
table option to true
. You could then opt out per column by setting the enableClickToCopy
option to false
on the column definition.
Customize Copy Buttons
The click to copy feature is built on top of the Mantine UnstyledButton and CopyButton components. You can customize the copy button by passing in the mantineCopyButtonProps
table or column option.
Click to Copy Example
First Name | Last Name | Email | City |
---|---|---|---|
Dylan | Murray | ||
Raquel | Kohler | ||
Ervin | Reinger | ||
Brittany | McCullough | ||
Branson | Frami |
View Extra Storybook Examples