npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@wasable/react-component-datatable

v0.1.1-rc.23

Published

DataTable

Downloads

3

Readme

Installation

Usage

Columns

| Property | Type | Required | Example | |------------------|-------------|----------|------------------------------------------------------| | name | string | no | the display name of our Column e.g. 'Name' | | sortField | string | no | If the column is sortable, sortField is required |
| cell | (row) => {} | yes | Render your own custom component | | filter | object | no | (link) | | operatorsOptions | array | no | Add operators options e.g [{value: '', label: ''}] |
| grow | number | no | flex-grow of the column |

Filters

| Property | Type | Required | Example | |------------------|--------------------------------------|----------|---------------------------------------------------------------------------| | render | (column) => {} OR string | yes | Render your own custom filter OR choose one ['text', 'number, 'button] | | field | string | yes | If the column is filterable, field is required | | operator | string | no | Default operator | | label | string | no | Button label | | ...rest | Props | no | It's possible to use defaultProps of inputs e.g placeholder |

Datatable

| Property | Type | Required | Default | Example | |-------------------------|--------------------------|----------|---------|---------------------------------------------------------| | title | string | no | | The Title displayed in the Table Header | | actions | component | no | | The Actions displayed in the Table Header | | columns | array | yes | [] | The column configuration |
| data | array | no | [] | Please, your data should have a unique identifier ! | | keyField | string | no | 'id' | Your data should have a unique identifier. | | dense | bool | no | false | Compact the row height | | striped | bool | no | true | Stripe color the odd rows | | highlightOnHover | bool | no | false | If rows are to be highlighted on hover | | pointerOnHover | bool | no | false | if rows show a point icon on hover | | noDataComponent | component OR string | no | | A custom component to display when there are no records |
| onRowClicked | func | no | | Callback to access the row, event on row click |
| onRowDoubleClicked | func | no | | Callback to access the row, event on row double click |
| noHeader | bool | no | false | Not displayed the Table Header |
| fixedHeader | bool | no | false | Makes the table header fixed |
| fixedHeaderScrollHeight | string | no | 50vh | Fixed the height value to the Table Body |
| showTableHead | bool | no | true | Displayed the Table Head |
| showTableSearch | bool | no | true | Displayed the Table Search |

Default Value

Row Selection

| Property | Type | Required | Default | Example | |-------------------------|--------------------------|----------|---------|----------------------------------------------------------------------------------| | selectableRows | bool | no | false | Whether to show selectable checkboxes | | selectableRowsHighlight | bool | no | false | Highlight a row when it is selected | | showSelectAll | bool | no | true | Whether to show the select all rows checkbox | | selectableRowDisabled | (row) => {} | no | | Disable row select based on a property in your data. e.g. row => row.isDisabled |

Replacing Components

Add property components (object) with a key present below :

  • LoadingWrapper
  • NoDataWrapper
  • Pagination
  • ResponsiveWrapper
  • Search
  • Table
  • TableBody
  • TableCell
  • TableCellCheckbox
  • TableColCheckbox
  • TableHead
  • TableHeader
  • TableHeadRow
  • TableRow
const CustomTable = ({ children, ...props }) => ( <div> <p> My New Texte </p> { children } </div> )

<DataTable components={{ Table: CustomTable }} />