trotl-table 1.0.4 → 1.0.5
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 +20 -2
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -10,9 +10,27 @@ A simple, flexible **Table UI** for React — with rows drag‑and‑drop, conte
|
|
|
10
10
|
|
|
11
11
|
```bash
|
|
12
12
|
npm install trotl-table
|
|
13
|
+
# or
|
|
14
|
+
yarn add trotl-table
|
|
13
15
|
|
|
14
16
|
|
|
15
|
-
⚡
|
|
17
|
+
⚡ Quick Start
|
|
18
|
+
Wrap your app with the provider:
|
|
19
|
+
|
|
20
|
+
import { StrictMode } from "react";
|
|
21
|
+
import { createRoot } from "react-dom/client";
|
|
22
|
+
import App from "./App";
|
|
23
|
+
import { TableProvider } from "trotl-table";
|
|
24
|
+
|
|
25
|
+
createRoot(document.getElementById("root")).render(
|
|
26
|
+
<StrictMode>
|
|
27
|
+
<TableProvider>
|
|
28
|
+
<App />
|
|
29
|
+
</TableProvider>
|
|
30
|
+
</StrictMode>
|
|
31
|
+
);
|
|
32
|
+
|
|
33
|
+
Render a table:
|
|
16
34
|
|
|
17
35
|
import React, { useState } from "react";
|
|
18
36
|
import { Table } from "trotl-table";
|
|
@@ -99,7 +117,7 @@ export default function Demo() {
|
|
|
99
117
|
🌟 Context Hooks
|
|
100
118
|
Use useTable to access global state:
|
|
101
119
|
|
|
102
|
-
import { useTable } from "
|
|
120
|
+
import { useTable } from "trotl-table";
|
|
103
121
|
|
|
104
122
|
function Toolbar({ tableId }) {
|
|
105
123
|
const { selectedRows, clearSelection } = useTable();
|