gradian-components
v1.0.5
Published
This is a Next.js test project that demonstrates the TableView component functionality.
Readme
Test Table View Project
This is a Next.js test project that demonstrates the TableView component functionality.
Features
- Interactive Table: Edit cells by double-clicking
- Drag & Drop: Reorder rows and columns by dragging
- Context Menus: Right-click for add/delete row/column options
- Sorting: Click column headers to sort data
- Cell Selection: Click and drag to select multiple cells
- Responsive Design: Scales and adapts to different screen sizes
- Toast Notifications: Feedback for user actions
Getting Started
Install dependencies:
pnpm installStart the development server:
pnpm devOpen http://localhost:3000 in your browser
Available Scripts
pnpm dev- Start development serverpnpm build- Build for productionpnpm start- Start production serverpnpm lint- Run ESLint
TableView Component Usage
The TableView component accepts the following props:
<TableView
filteredData={tableData}
tableData={tableData}
setTableData={setTableData}
updateInputData={updateInputData}
saveToHistory={saveToHistory}
tableScale={tableScale}
isTableExpanded={isTableExpanded}
inputData={inputData}
selectedFormat={selectedFormat}
parseInputData={parseInputData}
mode="edit" // "edit" | "view"
enableChangeColumnOrder={true} // boolean
showAsCardInMobile={false} // boolean
/>Props Description
mode: Controls the table behavior
"edit"(default): Full editing capabilities"view": Read-only mode, no editing allowed
enableChangeColumnOrder: Controls column drag & drop
true(default): Columns can be reordered by draggingfalse: Column reordering is disabled
showAsCardInMobile: Controls mobile display format
false(default): Shows table on mobiletrue: Shows data as cards on mobile devices
Dependencies
- Next.js 14
- React 18
- TypeScript
- Tailwind CSS
- Radix UI components
- Lucide React icons
