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 🙏

© 2025 – Pkg Stats / Ryan Hefner

react-sync-table

v0.0.8

Published

A Powerful React component library that streamlines data entry with auto-expanding rows and contextual input handling.

Downloads

9

Readme

React Sync Table

A Powerful React component library that streamlines data entry with auto-expanding rows and contextual input handling.

Demo

react-sync-table

🚀 Features

1. Auto-Add Empty Rows

  • A new empty row is automatically added at the bottom when the user starts typing in any input field.
  • Empty rows are not saved in the data until filled, reducing manual effort to add rows.

2. Smart Dropdown Behavior

  • Dropdowns in a row only open when the user focuses/clicks on that specific row’s input.
  • All dropdowns close automatically when the user clicks outside the table, ensuring a clean UI.

3. Input Type Support

  • Supports dropdown, text, number, and date inputs. Configure column types easily.

4. Row Deletion

  • Users can delete any row (except the auto-added empty row) to manage data flexibly.

5. Minimalist Design

  • Built to reduce form fatigue—focuses on quick data entry with intuitive interactions.

Basic Usage

Here's a simple example to get you started:

import { ReactSyncTable } from "react-sync-table";
import type { SchemaItem } from "react-sync-table";
import { useState } from "react";

// 1. Define your data type
type UserData = {
  name: string;
  age: number;
  country: string;
};

// 2. Create your table schema
const userTableSchema: SchemaItem[] = [
  {
    headerKey: "name",
    headerName: "Full Name",
    type: "text",
    width: "30%",
  },
  {
    headerKey: "age",
    headerName: "Age",
    type: "number",
    width: "20%",
  },
  {
    headerKey: "country",
    headerName: "Country",
    type: "dropdown",
    options: [
      { label: "USA", value: "USA" },
      { label: "Canada", value: "CAN" },
      { label: "UK", value: "UK" },
    ],
    width: "30%",
  },
];

// 3. Create your component
function UserTable() {
  const [users, setUsers] = useState<UserData[]>([]);

  const handleDataChange = (newData: UserData[]) => {
    console.log("Updated users:", newData);
    setUsers(newData);
  };

  return (
    <ReactSyncTable
      schema={userTableSchema}
      data={users}
      onChange={handleDataChange}
      maxWidth="800px"
    />
  );
}

Component Props

| Prop | Type | Required | Description | | -------- | --------------------- | -------- | ---------------------------------------------- | | schema | SchemaItem[] | Yes | Array of column configurations | | data | T[] | Yes | Array of objects containing the table data | | onChange | (data: T[]) => void | Yes | Callback function when data changes | | maxWidth | string | No | Maximum width of the table (default: "1000px") |

SchemaItem Configuration

interface SchemaItem {
  headerKey: string; // Field name in data object
  headerName: string; // Column headerKey text
  type: "display" | "dropdown" | "text" | "duration" | "number"; // Input type
  width?: string; // Column width (e.g. "20%")
  options?: Array<{
    // Required for dropdown type
    label: string;
    value: string;
  }>;
  closeOnSelection?: boolean; // Close dropdown after selection
  setRespectiveDetail?: string[]; // Additional fields to update
}

Development

  1. Clone the repository:

    git clone https://github.com/yourusername/react-sync-table.git
    cd react-sync-table
  2. Install dependencies:

    npm install
  3. Start the development server:

    npm run dev
  4. Build the package:

    npm run build

Contributing

Contributions are welcome! Please feel free to submit a Pull Request.