data-table-component-gif 0.0.3 → 0.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 +16 -13
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -1,33 +1,36 @@
|
|
|
1
|
-
# data-table-component
|
|
1
|
+
# data-table-component-gif
|
|
2
2
|
|
|
3
3
|
Simple React table component with sorting, searching and pagination.
|
|
4
4
|
|
|
5
5
|
## Installation
|
|
6
6
|
|
|
7
7
|
```bash
|
|
8
|
-
npm install data-table-component
|
|
8
|
+
npm install data-table-component-gif
|
|
9
9
|
```
|
|
10
10
|
|
|
11
|
-
(or yarn add data-table-component)
|
|
11
|
+
(or yarn add data-table-component-gif)
|
|
12
12
|
|
|
13
13
|
## Usage
|
|
14
14
|
|
|
15
15
|
```jsx
|
|
16
|
-
import React from
|
|
17
|
-
import { DataTable } from
|
|
16
|
+
import React from "react";
|
|
17
|
+
import { DataTable } from "data-table-component-gif";
|
|
18
18
|
|
|
19
19
|
const columns = [
|
|
20
|
-
{ key:
|
|
21
|
-
{ key:
|
|
22
|
-
];
|
|
23
|
-
const data = [
|
|
24
|
-
{ firstName: 'Alice', lastName: 'Smith' }
|
|
20
|
+
{ key: "firstName", label: "First Name" },
|
|
21
|
+
{ key: "lastName", label: "Last Name" },
|
|
25
22
|
];
|
|
23
|
+
const data = [{ firstName: "Alice", lastName: "Smith" }];
|
|
26
24
|
|
|
27
25
|
function App() {
|
|
28
|
-
return
|
|
29
|
-
<DataTable data={data} columns={columns} itemsPerPage={5} />
|
|
30
|
-
);
|
|
26
|
+
return <DataTable data={data} columns={columns} itemsPerPage={5} />;
|
|
31
27
|
}
|
|
32
28
|
```
|
|
33
29
|
|
|
30
|
+
> **Style note**
|
|
31
|
+
>
|
|
32
|
+
> Styling is provided via a CSS file in the package. You can import it anywhere you use the `DataTable` component:
|
|
33
|
+
>
|
|
34
|
+
> ```js
|
|
35
|
+
> import "data-table-component-gif/dist/data-table-component-gif.css";
|
|
36
|
+
> ```
|