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

simple-table-core

v0.6.1

Published

Any questions, support or features requests join me on Dicord <a href="https://discord.gg/RvKHCfg3PC" target="_blank" rel="noopener noreferrer">https://discord.gg/RvKHCfg3PC</a>. I am happy to help and make this table even better!

Downloads

2,234

Readme

Simple Table

Any questions, support or features requests join me on Dicord https://discord.gg/RvKHCfg3PC. I am happy to help and make this table even better!

Simple Table is a React grid package designed to provide a flexible and easy-to-use table component for your React applications.

Website

For more information, visit our website: Simple Table

Live Demo

Check out the live demo on CodeSandbox: Simple Table Pagination Example

Props

The Simple Table component accepts the following props:

  • defaultHeaders: An array of HeaderObject defining the table headers. Each HeaderObject includes:

    • label: A string representing the display name of the column header.
    • accessor: A string used to access the corresponding data in each row.
    • width: A number specifying the width of the column.
    • isEditable: An optional boolean indicating if the column is editable.
    • isSortable: An optional boolean indicating if the column is sortable.
    • type: An optional string specifying the data type of the column. Can be "string", "number", "boolean", "date", or "enum".
    • cellRenderer: An optional function that takes a row object and returns a ReactNode for custom cell rendering.
  • columnResizing: A boolean to enable or disable column resizing. Default is true.

  • draggable: A boolean to enable or disable column dragging.

  • editColumns: A boolean to enable or disable column editing.

  • height: The height of the table.

  • hideFooter: A boolean to hide or show the footer. Default is false.

  • nextIcon: A React element to display as the next page icon. Default is <AngleRightIcon />.

  • prevIcon: A React element to display as the previous page icon. Default is <AngleLeftIcon />.

  • rows: An array of data rows to be displayed in the table.

  • rowsPerPage: The number of rows to display per page. Default is 10.

  • selectableCells: A boolean to enable or disable cell selection.

  • shouldPaginate: A boolean to enable or disable pagination. Default is true.

  • sortDownIcon: A React element to display as the sort down icon.

  • sortUpIcon: A React element to display as the sort up icon.

  • onCellChange: A function that is called when a cell value changes. It receives an object with the following properties:

    • accessor: The accessor of the column whose cell value changed.
    • newValue: The new value of the cell.
    • newRowIndex: The index of the row in the current page.
    • originalRowIndex: The original index of the row in the entire dataset.
    • row: The entire row object.

Customizable Styles

All styles for the Simple Table are customizable and can be found in the table.css file. You can modify these styles to fit the design needs of your application.

CSS Variables

You can override the following CSS variables to customize the appearance of the table:

  • --st-border-radius
  • --st-border-color
  • --st-border-width
  • --st-resize-handle-color
  • --st-separator-border-color
  • --st-odd-row-background-color
  • --st-dragging-background-color
  • --st-selected-cell-background-color
  • --st-selected-first-cell-background-color
  • --st-border-top-color
  • --st-border-bottom-color
  • --st-border-left-color
  • --st-border-right-color
  • --st-border-top-white-color
  • --st-footer-background-color

CSS Class Names

The following CSS class names are used in the table and can be customized:

  • .st-wrapper
  • .st-table
  • .st-header-cell
  • .st-cell
  • .st-header-label
  • .st-header-resize-handle
  • .st-row-separator
  • .st-cell-odd-row
  • .st-dragging
  • .st-cell-selected
  • .st-cell-selected-first
  • .st-selected-top-border
  • .st-selected-bottom-border
  • .st-selected-left-border
  • .st-selected-right-border
  • .st-footer
  • .st-next-prev-btn
  • .st-page-btn
  • .st-page-btn.active
  • .editable-cell-input
  • .st-column-editor
  • .st-column-editor.open

License

This project is licensed under the MIT License - see the LICENSE file for details.