shadcn ui table component with dialog.
Hello im wondering if anyone has tried to implement a table row to act as a dialog trigger so i can open dialogs through each item in the table component
Solution:Jump to solution
Hello im wondering if anyone has tried to implement a table row to act as a dialog trigger so i can open dialogs through each item in the table component
4 Replies
from my understanding, you want to make a cell in every row a button to open a dialog?
Basically yeah. Shadcn has a DialogTrigger component to act as a open button
Ive tried it but it messes up the table. I dont know any other methods
idk how it is messing up the table for you, but basically yeah you can use the
cell
props of the column in the column headers definition to say that the entries will have a dialog button at that cell
it would be sth similar to the row action
section in the shadcn data table docs: https://ui.shadcn.com/docs/components/data-table#row-actions
without knowing more about what you did and what issues you faced i cant really help in more detailsData Table
Powerful table and datagrids built using TanStack Table.
Im using the normal table component not the datatable. But i might switch one day
At the end i will probably have to make a button to trigger it instead of using the whole row
Thanks 👍