ui
ui copied to clipboard
[Data Table] Use data that is not defined in columns within table?
I have data properties that I want to show in the table, yet not in a separate column. Instead, I want to to show a property on hover a label (using title
argument).
For example:
I extend the data array from the shadcn example to include a currency
property like so:
return [
{
id: "728ed52f",
amount: 100,
currency: "USD",
status: "pending",
email: "[email protected]",
},
{
id: "489e1d42",
amount: 125,
currency: "EUR",
status: "processing",
email: "[email protected]",
},
];
Is there a way to show the currency property as title
value for the corresponding value within the Amount column: For example:
Here is a code sandbox: https://codesandbox.io/p/devbox/vigilant-lumiere-9kvwvw?file=%2Fapp%2Fpage.tsx%3A6%2C1-21%2C5