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 🙏

© 2026 – Pkg Stats / Ryan Hefner

@xinosolutions/react-datatable

v1.0.4

Published

A modern, feature-rich React DataTable component with search, selection, and customizable columns

Readme

@xinosolutions/react-datatable

A modern, feature-rich React DataTable component with search functionality, pagination, row selection, and customizable theming.

npm version License: MIT


About XinoSolutions

XinoSolutions is a software development company dedicated to creating high-quality, developer-friendly solutions. We specialize in building modern React components and tools that help developers build better applications faster. Our commitment to excellence, clean code, and user experience drives everything we create.

This package is part of our open-source initiative to contribute valuable tools to the React ecosystem.


Features

  • Real-time Search - Search across all columns with instant filtering
  • Pagination - Full-featured pagination with customizable page sizes
  • Row Selection - Checkbox and radio button selection support
  • Customizable Columns - Multiple column types (text, number, HTML, custom render)
  • Theme Customization - Customizable theme colors via CSS variables
  • Responsive Design - Mobile-friendly and responsive layout
  • Sticky Header - Header stays visible while scrolling
  • Empty States - Beautiful empty state messages
  • Accessibility - ARIA labels and keyboard navigation support
  • TypeScript Ready - Works seamlessly with TypeScript projects
  • Zero Dependencies - No external dependencies (except React)

Installation

npm install @xinosolutions/react-datatable

or

yarn add @xinosolutions/react-datatable

or

pnpm add @xinosolutions/react-datatable

Quick Start

import React, { useState } from 'react';
import { DataTable } from '@xinosolutions/react-datatable';

function App() {
  const [selected, setSelected] = useState([]);

  const rows = [
    { id: 1, name: 'John Doe', email: '[email protected]', role: 'Developer' },
    { id: 2, name: 'Jane Smith', email: '[email protected]', role: 'Designer' },
    { id: 3, name: 'Bob Johnson', email: '[email protected]', role: 'Manager' },
  ];

  const columns = [
    { key: 'id', label: 'ID' },
    { key: 'name', label: 'Name' },
    { key: 'email', label: 'Email' },
    { key: 'role', label: 'Role' },
  ];

  return (
    <DataTable
      rows={rows}
      columns={columns}
      checkboxSelection={{
        selected,
        setSelected,
        selectBy: 'id'
      }}
    />
  );
}

export default App;

Props

DataTable Props

| Prop | Type | Required | Default | Description | |------|------|----------|---------|-------------| | rows | Array<Object> | Yes | - | Array of data objects to display in the table | | columns | Array<Column> | Yes | - | Array of column configuration objects | | pagination | Object | No | See below | Pagination configuration object | | checkboxSelection | Object | No | - | Checkbox selection configuration | | theme | Object | No | - | Theme customization object |

Pagination Object

| Property | Type | Default | Description | |----------|------|---------|-------------| | showTopPagination | boolean | true | Show pagination controls at the top | | showBottomPagination | boolean | true | Show pagination controls at the bottom | | defaultPageSize | number | 50 | Default number of items per page | | pageSizeOptions | Array<number> | [10, 50, 100, 500] | Available page size options |

CheckboxSelection Object

| Property | Type | Required | Description | |----------|------|----------|-------------| | selected | Array<Object> | Yes | Array of selected row objects | | setSelected | Function | Yes | Function to update selected rows | | selectBy | string | No | Key to use for row identification (default: "_id") |

Theme Object

| Property | Type | Description | |----------|------|-------------| | --table-theme-color | string | CSS variable for theme color (default: #4FAFA0) |


Column Types

Standard Column

Displays the value from the row object using the specified key.

{ key: 'name', label: 'Name' }

Number Column (Row Number)

Displays the row number automatically.

{ label: '#', type: 'number' }

HTML Column

Renders HTML content from the row data.

{ 
  key: 'description', 
  label: 'Description', 
  type: 'html' 
}

Custom Render Column

Use a custom render function for complete control over cell content.

{ 
  label: 'Actions', 
  render: (row, index) => (
    <button onClick={() => handleEdit(row)}>Edit</button>
  )
}

Examples

Basic Usage

import { DataTable } from '@xinosolutions/react-datatable';

const rows = [
  { id: 1, name: 'John Doe', email: '[email protected]' },
  { id: 2, name: 'Jane Smith', email: '[email protected]' },
];

const columns = [
  { key: 'id', label: 'ID' },
  { key: 'name', label: 'Name' },
  { key: 'email', label: 'Email' },
];

<DataTable rows={rows} columns={columns} />

With Checkbox Selection

import { useState } from 'react';
import { DataTable } from '@xinosolutions/react-datatable';

function App() {
  const [selected, setSelected] = useState([]);

  return (
    <DataTable
      rows={rows}
      columns={columns}
      checkboxSelection={{
        selected,
        setSelected,
        selectBy: 'id'
      }}
    />
  );
}

Custom Pagination

<DataTable
  rows={rows}
  columns={columns}
  pagination={{
    showTopPagination: true,
    showBottomPagination: false,
    defaultPageSize: 25,
    pageSizeOptions: [10, 25, 50, 100, 200]
  }}
/>

Custom Theme

<DataTable
  rows={rows}
  columns={columns}
  theme={{
    '--table-theme-color': '#3b82f6' // Custom blue theme
  }}
/>

Mixed Column Types

const columns = [
  { label: '#', type: 'number' },
  { key: 'id', label: 'ID' },
  { key: 'name', label: 'Name' },
  { key: 'email', label: 'Email' },
  { 
    key: 'description', 
    label: 'Description', 
    type: 'html' 
  },
  { 
    label: 'Actions', 
    render: (row) => (
      <div>
        <button onClick={() => edit(row)}>Edit</button>
        <button onClick={() => delete(row)}>Delete</button>
      </div>
    )
  },
];

Search Functionality

The DataTable includes built-in search functionality that:

  • Searches across all columns automatically
  • Filters results in real-time as you type
  • Shows result count (e.g., "5 of 12 results")
  • Displays "No Data Found" when search returns no results
  • Resets pagination to page 1 when search query changes

The search is case-insensitive and searches all column values that have a key property.


Pagination Features

  • First/Previous/Next/Last buttons - Navigate between pages
  • Page numbers - Click to jump to a specific page
  • Page size selector - Change items per page
  • Record information - Shows "Showing X to Y of Z records"
  • Page information - Displays "Page X of Y"
  • Smart page number display - Shows ellipsis for large page counts
  • Responsive design - Adapts to mobile screens

Theme Customization

Customize the table theme by passing a theme object with CSS variables:

<DataTable
  rows={rows}
  columns={columns}
  theme={{
    '--table-theme-color': '#3b82f6' // Your brand color
  }}
/>

The theme color is used for:

  • Checkbox checked states
  • Radio button selected states
  • Pagination active page button
  • Focus states on interactive elements

Default theme color: #4FAFA0 (teal)


Requirements

  • React: 16.8+ / 17+ / 18+ / 19+
  • React DOM: 16.8+ / 17+ / 18+ / 19+

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

License

MIT License - see LICENSE file for details.


Support

For issues, feature requests, or questions: