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

@bavuchoko/js-table

v1.0.26

Published

A customizable React table component with resizing, reordering, and pagination.

Readme

🧩 JsTable

React 기반의 커스터마이징 가능한 테이블 컴포넌트입니다. 다음과 같은 기능을 제공합니다:

  • ✅ 컬럼 숨김/표시 설정
  • 🔁 컬럼 순서 변경 (드래그)
  • 📏 컬럼 너비 조절 (리사이즈)
  • ☑️ 체크박스 행 선택
  • 🎨 테마 및 배경 지정
  • 📄 헤더 렌더링 커스터마이징
  • 📚 페이징 지원

🚀 설치

npm install @bavuchoko/js-table

✨ 사용 예시

import { JsTable } from '@bavuchoko/js-table';

const headerList = [
  { key: 'id', label: 'ID' },
  { key: 'name', label: 'Name' },
  { key: 'email', label: 'Email' },
  {
    key: 'status',
    label: 'Status',
    renderer: (row) => <span>{row.status === 'active' ? '🟢 Active' : '🔴 Inactive'}</span>
  }
];

const dataList = [
  { id: 1, name: 'Alice', email: '[email protected]', status: 'active' },
  { id: 2, name: 'Bob', email: '[email protected]', status: 'inactive' },
  // ...
];

...

<div style={{width:'1000px', height:'300px'}}>
    <JsTable
      header={headerList}
      data={dataList}
      setting={{
        hidden: ['email'],
        order: ['id', 'name', 'email', 'status']
      }}
      page={{ currentPage: 0, size: 10, totalElements: 100 }}
      usePagination="bottom"
      useSetting={true}
      background="light"
      theme="dark"
      resizable={true}
      draggable={true}
      onHeaderMove={(newOrder) => console.log('New order:', newOrder)}
      onResizeWidth={(widths) => console.log('Widths:', widths)}
      onRowClick={(id) => console.log('Clicked row ID:', id)}
      onPageChange={(page) => console.log('Changed to page:', page)}
    />
</div>

...


🧾 Props

| Prop | Type | Description | |------------------|------------------------------------------------------------------|-------------| | header | Array<{ key: string; label: string; renderer?: (row) => JSX }> | 테이블 컬럼 정의 | | data | any[] | 렌더링할 데이터 배열 | | setting | { hidden?: string[]; order?: string[] } | 초기 숨김 컬럼, 순서 설정 | | page | { currentPage: number; size: number; totalElements: number } | 페이징 정보 | | usePagination | 'top' \| 'bottom' \| boolean | 페이징 위치 또는 사용 여부 | | useSetting | boolean | 컬럼 설정 팝업 사용 여부 | | background | 'light' \| 'dark' \| string | 테이블 배경색 또는 클래스 | | theme | 'light' \| 'dark' | 테이블 테마 스타일 | | style | { header?: CSSProperties; body?: CSSProperties } | 사용자 정의 스타일 | | resizable | boolean | 컬럼 너비 조절 가능 여부 | | draggable | boolean | 컬럼 순서 드래그 가능 여부 | | onHeaderMove | (order: string[]) => void | 컬럼 순서 변경 콜백 | | onResizeWidth | (widths: number[]) => void | 컬럼 리사이즈 콜백 | | onRowClick | (id: any) => void | 행 클릭 콜백 | | onPageChange | (page: number) => void | 페이지 변경 콜백 |


⚙️ 내부 Hook 구성

| Hook | 역할 설명 | |---------------------|-----------| | useDataHandler | 체크박스 및 row 데이터 핸들링 | | useHeaderHandler | 컬럼 순서 및 숨김 처리 | | useColumnWidths | 컬럼 리사이즈 로직 처리 | | useDragHandler | 드래그 기반 컬럼 순서 변경 | | useSettingPop | 설정 팝업 상태 관리 | | useCustomStyle | 테마/배경 스타일 반환 | | useHiddenHeader | 숨김 컬럼 상태 및 토글 제어 |


📁 파일 구조

JsTable/
├── JsTable.tsx                # 메인 테이블 컴포넌트
├── hook/
│   ├── useDataHandler.ts
│   ├── useHeaderHandler.ts
│   ├── useColumnWidths.ts
│   ├── useDragHandler.ts
│   ├── useSettingPop.ts
│   ├── useCustomStyle.ts
│   └── useHiddenHeader.ts
└── utils/
    ├── Pagination.tsx
    ├── SettingPop.tsx
    ├── Blind.tsx
    └── Empty.tsx