You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+23-58Lines changed: 23 additions & 58 deletions
Original file line number
Diff line number
Diff line change
@@ -56,6 +56,19 @@ This component will be upgraded and updated regularly for better use, in the sma
56
56
- Supports search.
57
57
- Supports pagination if an api url added for better SEO and user experience.
58
58
- Supports external data by props data and internal data by adding the api url.
59
+
## Props
60
+
61
+
62
+
| prop name | required | options | description |
63
+
| --------- |:--------:| ------- | ----------- |
64
+
|**headCells**|`true`| Array of object | The **headCells** props tell the component what columns do you want to show from the array and how you want to show it. There are some required object keys: `id`, `label`, `width` (as integer in px); and other options like: `sortable` (bool), `numeric` (bool !helps to sort as number!), `render` (a custom column, html, css, javascript, react !you can do all!) |
65
+
|**data**|`true` if `url` prop is not used | Array of object | Prerendered data useful if using [NextJs](http://nextjs.org) framework for server side rendering OR `url` prop can't be used in your case...|
66
+
|**url**|`true` if `data` prop is not used | String | fetch data on the component mount if prop `data` doesn't exist. And on search adding a query param called `search`, on row number change adding a query param called `limit` and on page change adding a query param called `page`. The best news is that they also work as a combination on the this `url` prop that will work as `paginated api`|
67
+
|**title**|`false`| String/React component | It's mainly to be a title or a button |
68
+
|**searchDebounceTime**|`false`| Integer default is 800 in (ms) | configure the time you need the search api to start seaching after stop typing in the search box|
69
+
|**noPagination**|`false`| Boolean ||
70
+
|**rowsPerPage**|`false`| Integer default is 10 ||
71
+
|**rowsPerPageOptions**|`false`| array default is [5, 10, 25, 50]||
59
72
60
73
## Example
61
74
@@ -106,43 +119,25 @@ const headCells = [
106
119
107
120
constdata= [
108
121
{
109
-
_id:"6144e83a966145976c75cdfe",
110
-
email:"minagerges123@gmail.com",
122
+
_id:"6144145976c7fe",
123
+
email:"minageres123@gmail.com",
111
124
name:"Mina",
112
-
phone:"+96170345114",
125
+
phone:"+9617099995114",
113
126
subject:"test",
114
127
message:"ahlannn",
115
128
date:"2021-09-17 19:10:50",
116
129
},
117
130
{
118
-
_id:"61439914086a4f4e9f9d87cd",
119
-
email:"amineamine1996@gmail.com",
120
-
name:"amine amine",
121
-
phone:"+96176466341",
122
-
subject:"12121",
123
-
message:"121212121212121",
124
-
date:"2021-09-16 22:20:52",
125
-
},
126
-
{
127
-
_id:"61439887086a4f4e9f9d87cc",
131
+
_id:"6143989f9d87cc",
128
132
email:"as@a.com",
129
133
name:"as",
130
-
phone:"+96176466341",
134
+
phone:"+9617646699991",
131
135
subject:"as",
132
136
message:"as",
133
137
date:"2021-09-16 22:18:31",
134
138
},
135
139
{
136
-
_id:"6143985d086a4f4e9f9d87cb",
137
-
email:"amineamine19961996@gmail.com",
138
-
name:"amine amine",
139
-
phone:"+96176466341",
140
-
subject:"1234",
141
-
message:"sdsdsd",
142
-
date:"2021-09-16 22:17:49",
143
-
},
144
-
{
145
-
_id:"614397edcbfc69177da008c8",
140
+
_id:"614397edc9177d8c8",
146
141
email:"amine@amine.com",
147
142
name:"amine",
148
143
phone:"+334343439393993",
@@ -151,46 +146,19 @@ const data = [
151
146
date:"2021-09-16 22:15:57",
152
147
},
153
148
{
154
-
_id:"6143b810d713e67dfca4985c",
149
+
_id:"6143be67dfca4985c",
155
150
email:"dominique.amine@gmail.com",
156
151
name:"Dominique",
157
-
phone:"+96181304686",
152
+
phone:"+96189904686",
158
153
subject:"Dev ",
159
154
message:"Ohmaga",
160
155
date:"2021-09-16 21:33:04",
161
156
},
162
157
{
163
-
_id:"61439b2f0b93c171aa1cf475",
164
-
email:"amineamine19961996@gmail.com",
165
-
name:"Jean Claude Samaha Bartender",
166
-
phone:"+96170492931",
167
-
subject:"cv application",
168
-
message:"hello amine this a test email ",
169
-
date:"2021-09-16 19:29:51",
170
-
},
171
-
{
172
-
_id:"6117aeca1e925fd9dbc2bc6d",
173
-
email:"amineamine19961996@gmail.com",
174
-
name:"amine amine",
175
-
phone:"+96176466341",
176
-
subject:"1234",
177
-
message:"wwww",
178
-
date:"2021-08-14 14:53:46",
179
-
},
180
-
{
181
-
_id:"61141f32cbfa7dbd8dba189f",
182
-
email:"amineamine19961996@gmail.com",
183
-
name:"amine amine",
184
-
phone:"+96176466341",
185
-
subject:"aa",
186
-
message:"23232",
187
-
date:"2021-08-11 22:04:18",
188
-
},
189
-
{
190
-
_id:"61141e57cbfa7dbd8dba189e",
158
+
_id:"61141e57a7dbd8a189e",
191
159
email:"amineamine19961996@gmail.com",
192
160
name:"amine amine",
193
-
phone:"+96176466341",
161
+
phone:"+96176776341",
194
162
subject:"qw",
195
163
message:"qw",
196
164
date:"2021-08-11 22:00:39",
@@ -203,9 +171,6 @@ export default function Exemple() {
Copy file name to clipboardExpand all lines: package.json
+1-1Lines changed: 1 addition & 1 deletion
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,6 @@
1
1
{
2
2
"name": "react-next-table",
3
-
"version": "1.0.0",
3
+
"version": "1.0.1",
4
4
"description": "The SmartTable is a react simple Component based on HTML, CSS, JavaScript, bootstrap. Used for fetching data from a defined api with an option of pagination and search. You can find also many useful options like sorting, selecting columns to show, custom render of cells, fully responsive on all devices, custom react title...",
0 commit comments