shadcn.io is not affiliated with official shadcn/ui
Data Table examples · Advanced
Data Table with Actions for React
A table of payments with a menu of actions at the end of each row.
Five payments with a Dropdown Menu at the end of each row: copy the payment ID, view the customer, view the details. One menu button per row keeps the table narrow however many actions there are. Use it for admin lists, orders and accounts where each row has its own operations.
Preview
Installation
FAQ
Where do the row actions live?
In a display column with the id actions. Its header is a visually hidden Actions label, and its cell renders the menu for row.original.
What opens the menu?
A ghost icon Button labeled Open menu with MoreHorizontalIcon. DropdownMenuTrigger renders it through render.
What does Copy payment ID do?
It writes payment.id to the clipboard with navigator.clipboard.writeText. The item runs it from onClick. View customer and View payment details have no handler yet.
How is the menu laid out?
An Actions group label over Copy payment ID, a separator, then the two View items. The menu opens below the button, aligned to its end. That's align="end" on DropdownMenuContent.
Related
- Basic Data Table with CheckboxesA table of products with a checkbox on
- Expandable Sub-Rows Data TableA table of projects where each row
- Table Sort Menu Context MenuA table column context menu to sort
- Simple Dropdown with Icons Dropdown MenuA short menu behind a dots button with an
- Data Table with FiltersA table of users with two inputs that
- Paginated Data TableA table of transactions, five per page