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:
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
Jump to solution
4 Replies
cornflour
cornflour2y ago
from my understanding, you want to make a cell in every row a button to open a dialog?
Maj
MajOP2y ago
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
cornflour
cornflour2y ago
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 details
Data Table
Powerful table and datagrids built using TanStack Table.
Maj
MajOP2y ago
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 👍
Want results from more Discord servers?
Add your server