Command Palette

Search for a command to run...

Docs
Table Dialog

Table Dialog

An editable table component with inline editing capabilities through dialog modals and row selection functionality.

Loading...

Installation

Usage

import TableDialog from "@/components/ui/table-dialog";
 
const userData = [
  {
    id: "1",
    name: "John Doe",
    email: "john@company.com",
    role: "Manager",
    status: "Active" as const,
    balance: "$1,250.00",
  },
  // ... more users
];
 
export default function MyEditableTable() {
  return (
    <TableDialog data={userData} footerTotal="$5,000.00" maxHeight="500px" />
  );
}

Props

PropTypeDefaultDescription
dataUser[]defaultUsersArray of user objects to display
footerTotalstring"$3,400.00"Total amount shown in table footer
maxHeightstring"400px"Maximum height for scrollable table area

User Type

PropertyTypeDescription
idstringUnique identifier for the user
namestringUser's full name
emailstringUser's email address
rolestringUser's role/position
status"Active" | "Inactive"User's current status
balancestringFormatted balance amount

Features

  • Inline Editing: Click edit button to open dialog for row editing
  • Dialog Form: Modal dialog with form inputs for all user fields
  • Row Selection: Multi-select rows with checkboxes
  • Select All: Header checkbox to select/deselect all rows
  • Status Badges: Visual status indicators with color coding
  • Scrollable Content: Fixed header with scrollable body
  • Action Menu: Dropdown menu for row-level actions
  • Footer Summary: Total balance displayed in table footer
  • Form Validation: Proper form handling with select dropdowns
  • Responsive Design: Mobile-friendly layout and interactions