luxtable 0.2.2 → 0.3.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +178 -30
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,58 +1,206 @@
|
|
|
1
|
-
💎 LuxTable
|
|
2
|
-
|
|
1
|
+
# 💎 LuxTable
|
|
2
|
+
|
|
3
|
+
**Enterprise-Grade Data Management. Minimalist Aesthetics.**
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/luxtable)
|
|
6
|
+
[](https://www.npmjs.com/package/luxtable)
|
|
7
|
+
[](https://opensource.org/licenses/MIT)
|
|
8
|
+
|
|
3
9
|
LuxTable is a high-performance, feature-rich data grid library designed specifically for the modern React ecosystem. It bridges the gap between complex data manipulation and the clean, modular philosophy of Shadcn UI. Built for developers who refuse to choose between power and beauty.
|
|
4
10
|
|
|
5
|
-
✨ Key Features
|
|
6
|
-
⚡ High-Velocity Performance: Optimized virtualization engine capable of rendering massive datasets with 60fps fluidity.
|
|
11
|
+
## ✨ Key Features
|
|
7
12
|
|
|
8
|
-
|
|
13
|
+
- ⚡ **High-Velocity Performance** - Optimized rendering engine capable of handling massive datasets with 60fps fluidity
|
|
14
|
+
- 🎨 **Shadcn-Native Design** - Crafted with Tailwind CSS and Radix UI primitives
|
|
15
|
+
- 🔍 **Advanced Filtering** - Column-level filters with multiple filter types (text, number, select)
|
|
16
|
+
- 🔄 **Smart Sorting** - Multi-column sorting with intuitive click interactions
|
|
17
|
+
- ✅ **Row Selection** - Single and multi-select with checkbox support
|
|
18
|
+
- 📄 **Pagination** - Built-in pagination with customizable page sizes
|
|
19
|
+
- 🛠️ **Column Actions** - Hide/show columns, sorting controls in a unified dropdown
|
|
20
|
+
- 🔎 **Global Search** - Search across all columns instantly
|
|
21
|
+
- 🔒 **Type-Safe Excellence** - First-class TypeScript support with full type inference
|
|
22
|
+
- 📱 **Fully Responsive** - Adaptive layouts from ultra-wide monitors to mobile screens
|
|
9
23
|
|
|
10
|
-
|
|
24
|
+
## 🚀 Quick Start
|
|
11
25
|
|
|
12
|
-
|
|
26
|
+
### Installation (Recommended: shadcn CLI)
|
|
13
27
|
|
|
14
|
-
|
|
28
|
+
LuxTable uses the **shadcn registry** approach - components are copied directly into your project, giving you full control over the code.
|
|
15
29
|
|
|
16
|
-
|
|
30
|
+
#### Prerequisites
|
|
17
31
|
|
|
18
|
-
|
|
19
|
-
Installation
|
|
20
|
-
Bash
|
|
32
|
+
Make sure you have shadcn/ui set up in your project:
|
|
21
33
|
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
34
|
+
```bash
|
|
35
|
+
pnpm dlx shadcn@latest init
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
#### Install LuxTable
|
|
39
|
+
|
|
40
|
+
```bash
|
|
41
|
+
# Install the main LuxTable component
|
|
42
|
+
pnpm dlx shadcn@latest add "https://luxtable.dev/r/lux-table.json"
|
|
43
|
+
|
|
44
|
+
# Optional: Install pre-built cell renderers
|
|
45
|
+
pnpm dlx shadcn@latest add "https://luxtable.dev/r/lux-table-cell-renderers.json"
|
|
46
|
+
|
|
47
|
+
# Optional: Install column helper utilities
|
|
48
|
+
pnpm dlx shadcn@latest add "https://luxtable.dev/r/lux-table-column-helper.json"
|
|
49
|
+
```
|
|
25
50
|
|
|
26
|
-
|
|
51
|
+
This will:
|
|
52
|
+
- Copy LuxTable components to your `components/lux-table` folder
|
|
53
|
+
- Install required dependencies (`@tanstack/react-table`, `lucide-react`)
|
|
54
|
+
- Install required shadcn/ui components (button, checkbox, dropdown-menu, input, select)
|
|
27
55
|
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
|
|
31
|
-
|
|
56
|
+
### Alternative: npm Package
|
|
57
|
+
|
|
58
|
+
If you prefer using LuxTable as an npm package:
|
|
59
|
+
|
|
60
|
+
```bash
|
|
61
|
+
npm install luxtable
|
|
62
|
+
# or
|
|
63
|
+
pnpm add luxtable
|
|
64
|
+
# or
|
|
65
|
+
yarn add luxtable
|
|
66
|
+
```
|
|
67
|
+
|
|
68
|
+
> **Note:** When using the npm package, you need to configure your `tailwind.config.js` to include LuxTable:
|
|
69
|
+
> ```js
|
|
70
|
+
> module.exports = {
|
|
71
|
+
> content: [
|
|
72
|
+
> "./src/**/*.{js,ts,jsx,tsx}",
|
|
73
|
+
> "./node_modules/luxtable/dist/**/*.{js,mjs}",
|
|
74
|
+
> ],
|
|
75
|
+
> };
|
|
76
|
+
> ```
|
|
77
|
+
|
|
78
|
+
### Basic Usage
|
|
79
|
+
|
|
80
|
+
```tsx
|
|
81
|
+
import { LuxTable } from "@/components/lux-table/lux-table";
|
|
82
|
+
import { ColumnDef } from "@tanstack/react-table";
|
|
83
|
+
|
|
84
|
+
type User = {
|
|
85
|
+
id: number;
|
|
86
|
+
name: string;
|
|
87
|
+
email: string;
|
|
88
|
+
status: "active" | "inactive";
|
|
89
|
+
};
|
|
90
|
+
|
|
91
|
+
const columns: ColumnDef<User>[] = [
|
|
92
|
+
{
|
|
93
|
+
accessorKey: "id",
|
|
94
|
+
header: "ID",
|
|
95
|
+
},
|
|
96
|
+
{
|
|
97
|
+
accessorKey: "name",
|
|
98
|
+
header: "Name",
|
|
99
|
+
},
|
|
100
|
+
{
|
|
101
|
+
accessorKey: "email",
|
|
102
|
+
header: "Email",
|
|
103
|
+
},
|
|
104
|
+
{
|
|
105
|
+
accessorKey: "status",
|
|
106
|
+
header: "Status",
|
|
107
|
+
},
|
|
108
|
+
];
|
|
109
|
+
|
|
110
|
+
const data: User[] = [
|
|
111
|
+
{ id: 1, name: "John Doe", email: "john@example.com", status: "active" },
|
|
112
|
+
{ id: 2, name: "Jane Smith", email: "jane@example.com", status: "inactive" },
|
|
32
113
|
];
|
|
33
114
|
|
|
34
115
|
export default function App() {
|
|
35
116
|
return (
|
|
36
|
-
<LuxTable
|
|
37
|
-
data={
|
|
38
|
-
columns={columns}
|
|
117
|
+
<LuxTable
|
|
118
|
+
data={data}
|
|
119
|
+
columns={columns}
|
|
39
120
|
options={{
|
|
40
121
|
pagination: true,
|
|
122
|
+
filtering: true,
|
|
41
123
|
selection: "multiple",
|
|
124
|
+
showToolbar: true,
|
|
42
125
|
}}
|
|
43
126
|
/>
|
|
44
127
|
);
|
|
45
128
|
}
|
|
46
|
-
|
|
47
|
-
|
|
129
|
+
```
|
|
130
|
+
|
|
131
|
+
## 📦 Cell Renderers
|
|
132
|
+
|
|
133
|
+
LuxTable comes with built-in cell renderers for common use cases:
|
|
134
|
+
|
|
135
|
+
```tsx
|
|
136
|
+
import { StatusCell, ProgressCell, DateCell, CopyableCell } from "@/components/lux-table/cell-renderers";
|
|
137
|
+
|
|
138
|
+
// Status badges
|
|
139
|
+
{
|
|
140
|
+
accessorKey: "status",
|
|
141
|
+
header: "Status",
|
|
142
|
+
cell: ({ row }) => <StatusCell value={row.getValue("status")} />,
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
// Progress bars
|
|
146
|
+
{
|
|
147
|
+
accessorKey: "progress",
|
|
148
|
+
header: "Progress",
|
|
149
|
+
cell: ({ row }) => <ProgressCell value={row.getValue("progress")} />,
|
|
150
|
+
}
|
|
151
|
+
|
|
152
|
+
// Formatted dates
|
|
153
|
+
{
|
|
154
|
+
accessorKey: "createdAt",
|
|
155
|
+
header: "Created",
|
|
156
|
+
cell: ({ row }) => <DateCell value={row.getValue("createdAt")} />,
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
// Copy to clipboard
|
|
160
|
+
{
|
|
161
|
+
accessorKey: "id",
|
|
162
|
+
header: "ID",
|
|
163
|
+
cell: ({ row }) => <CopyableCell value={row.getValue("id")} />,
|
|
164
|
+
}
|
|
165
|
+
```
|
|
166
|
+
|
|
167
|
+
## 🎯 Options
|
|
168
|
+
|
|
169
|
+
| Option | Type | Default | Description |
|
|
170
|
+
|--------|------|---------|-------------|
|
|
171
|
+
| `pagination` | `boolean` | `false` | Enable/disable pagination |
|
|
172
|
+
| `pageSize` | `number` | `10` | Default rows per page |
|
|
173
|
+
| `filtering` | `boolean` | `false` | Enable column-level filtering |
|
|
174
|
+
| `selection` | `"single" \| "multiple" \| "none"` | `"none"` | Row selection mode |
|
|
175
|
+
| `showToolbar` | `boolean` | `false` | Show toolbar with search and column visibility |
|
|
176
|
+
| `showGlobalSearch` | `boolean` | `true` | Show global search in toolbar |
|
|
177
|
+
| `showColumnVisibility` | `boolean` | `true` | Show column visibility controls |
|
|
178
|
+
|
|
179
|
+
## 🛠 Tech Stack
|
|
180
|
+
|
|
181
|
+
- **Core**: React & TanStack Table
|
|
182
|
+
- **Styling**: Tailwind CSS
|
|
183
|
+
- **Primitives**: Radix UI
|
|
184
|
+
- **Icons**: Lucide React
|
|
185
|
+
|
|
186
|
+
## 📖 Documentation
|
|
187
|
+
|
|
188
|
+
Visit our [documentation](https://luxtable.dev/docs) for detailed guides and examples.
|
|
189
|
+
|
|
190
|
+
## 💡 Why LuxTable?
|
|
48
191
|
|
|
49
|
-
|
|
50
|
-
Core: React & TanStack Table (Logical Layer)
|
|
192
|
+
Most data grids are either too lightweight for complex tasks or too bloated with legacy styles. LuxTable is built from the ground up to be **headless-first but styled-ready**. It provides the engine you need for heavy data work, wrapped in the minimalist aesthetic that modern users expect.
|
|
51
193
|
|
|
52
|
-
|
|
194
|
+
### Why shadcn Registry?
|
|
53
195
|
|
|
54
|
-
|
|
196
|
+
By using the shadcn registry approach instead of a traditional npm package:
|
|
55
197
|
|
|
56
|
-
|
|
198
|
+
- ✅ **Full Control** - Components are in your codebase, customize freely
|
|
199
|
+
- ✅ **No CSS Conflicts** - Uses your project's Tailwind configuration
|
|
200
|
+
- ✅ **Smaller Bundle** - Only include what you need
|
|
201
|
+
- ✅ **Easy Updates** - Re-run the add command to update
|
|
202
|
+
- ✅ **Matches Your Stack** - Works seamlessly with your existing shadcn/ui components
|
|
57
203
|
|
|
204
|
+
## 📄 License
|
|
58
205
|
|
|
206
|
+
MIT © [LuxTable](https://github.com/luxtable/luxtable)
|