react-tailwind-table 1.1.0 → 1.1.2

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 CHANGED
@@ -64,13 +64,13 @@ A tailwind project would just need to import the react component using `import T
64
64
 
65
65
  ### None Tailwind Project
66
66
  None tailwind users can import this component in any react project of choice, no matter if they are using a css library or not. This can easily be achieved with two lines of code.
67
- `import Table from 'react-tailwind-table'` and `import 'react-tailwind-table/index.css'`
67
+ `import Table from 'react-tailwind-table'` and `import 'react-tailwind-table/dist/index.css'`
68
68
 
69
69
  ```tsx
70
70
  import React, { Component } from 'react'
71
71
 
72
72
  import Table from 'react-tailwind-table';
73
- import 'react-tailwind-table/index.css';
73
+ import 'react-tailwind-table/dist/index.css';
74
74
 
75
75
  class Example extends Component {
76
76
  render() {
@@ -98,7 +98,7 @@ interface Iprop {
98
98
  columns: Icolumn[],
99
99
  per_page?: number,
100
100
  table_header?: string,
101
- no_content_text?: string,
101
+ no_content_text?: React.ReactNode,
102
102
  debounce_search?: number,
103
103
  show_search?: boolean,
104
104
  should_export?: boolean,
@@ -298,7 +298,13 @@ type searchCallback = (search_word: string, result?: Irow[] | []) => void
298
298
 
299
299
  ### No Content Message
300
300
 
301
- When there is no data to display (rows props is empty), the `No Data Availaible` text is shown. The `no_content_text` props controls the text.
301
+ When there is no data to display (rows props is empty), the `No Data Availaible` text is shown. The `no_content_text` prop controls what is shown. It accepts anything React can render: a string, a number, or a React element such as a component:
302
+
303
+ ```jsx
304
+ <Table columns={columns} rows={[]} no_content_text="Nothing to see here" />
305
+
306
+ <Table columns={columns} rows={[]} no_content_text={<EmptyState />} />
307
+ ```
302
308
 
303
309
 
304
310
  ### Hide Search
@@ -430,7 +436,7 @@ interface ItableStyle {
430
436
 
431
437
  import React from 'react'
432
438
  import Table from 'react-tailwind-table'
433
- import 'react-tailwind-table/index.css' //use for a non tailwind project
439
+ import 'react-tailwind-table/dist/index.css' //use for a non tailwind project
434
440
 
435
441
 
436
442
  class App extends React.Component {