ui icon indicating copy to clipboard operation
ui copied to clipboard

[Data Table] Use data that is not defined in columns within table?

Open kalaschnik opened this issue 1 year ago • 0 comments

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: PixelSnap 2024-02-06 at 13 28 55

Here is a code sandbox: https://codesandbox.io/p/devbox/vigilant-lumiere-9kvwvw?file=%2Fapp%2Fpage.tsx%3A6%2C1-21%2C5

kalaschnik avatar Feb 05 '24 13:02 kalaschnik