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

@topgrid/grid-renderers

v0.3.0

Published

Cell renderers: Button, Badge, Check, Link, Number, Date, Icon

Readme

@topgrid/grid-renderers

Cell renderers: Button, Badge, Check, Link, Number, Date, Icon

Installation

pnpm add @topgrid/grid-renderers
# or
npm install @topgrid/grid-renderers
# or
yarn add @topgrid/grid-renderers

Peer Dependencies

| Package | Version | |---------|---------| | @tanstack/react-table | >=8.0.0 <9.0.0 | | react | ^18.0.0 \|\| ^19.0.0 | | react-dom | ^18.0.0 \|\| ^19.0.0 |

Usage

import {
  TextCell,
  NumberCell,
  DateCell,
  StatusBadgeCell,
  ButtonCell,
  LinkCell,
  CheckCell,
} from '@topgrid/grid-renderers';

const columns = [
  {
    accessorKey: 'name',
    header: 'Name',
    cell: (info) => <TextCell value={info.getValue()} />,
  },
  {
    accessorKey: 'amount',
    header: 'Amount',
    cell: (info) => <NumberCell value={info.getValue()} format="currency" />,
  },
  {
    accessorKey: 'status',
    header: 'Status',
    cell: (info) => (
      <StatusBadgeCell
        value={info.getValue()}
        statusMap={{ active: 'green', inactive: 'gray' }}
      />
    ),
  },
  {
    accessorKey: 'active',
    header: 'Active',
    cell: (info) => <CheckCell checked={info.getValue()} readOnly />,
  },
  {
    accessorKey: 'url',
    header: 'Link',
    // Use `value` prop (preferred). `label` retained as deprecated alias.
    cell: (info) => <LinkCell value={String(info.getValue())} href="/detail/123" />,
  },
  {
    accessorKey: 'action',
    header: 'Action',
    // Use `value` prop (preferred). `label` retained as deprecated alias.
    cell: () => <ButtonCell value="편집" onClick={() => {}} variant="ghost" />,
  },
];

Main API

| Export | Description | |--------|-------------| | TextCell | Plain text renderer | | NumberCell | Formatted number renderer | | DateCell | Formatted date/datetime renderer | | StatusBadgeCell | Colored status badge renderer | | LinkCell | Anchor link renderer | | ButtonCell | Action button renderer | | CheckCell | Checkbox renderer | | IconCell | Icon renderer | | TagCell | Tag/chip renderer | | AvatarCell | Avatar image renderer | | ProgressCell | Progress bar renderer | | EditableCell | Inline editable cell renderer | | formatNumberString | Number formatting utility | | formatDateTimeFromDateTimeString | Date formatting utility |

Migration Notes

LinkCell / ButtonCell — value prop (v0.1.0)

value is the preferred prop for display text. The label prop is retained as a deprecated alias for one release cycle and will be removed in the next major version.

// Preferred (v0.1.0+)
<LinkCell value="링크 텍스트" href="/detail" />
<ButtonCell value="편집" onClick={handler} />

// Deprecated (still works, remove before next major)
<LinkCell label="링크 텍스트" href="/detail" />
<ButtonCell label="편집" onClick={handler} />

Action / Avatar Column Pattern (ADR-018 X-B)

buttonavatar 컬럼은 registry slot 으로 wire 되지 않습니다. onClick (ButtonCell) 과 name (AvatarCell) 이 required prop 으로 cell value 단순 lookup 으로는 공급 불가합니다. type-safe 한 컬럼 정의를 위해 column.cell 에 직접 명시하세요:

import { ButtonCell, AvatarCell } from '@topgrid/grid-renderers';
import { createColumns } from '@topgrid/grid-core';

// ButtonCell (action 컬럼)
const columns = createColumns<MyRow>([
  {
    id: 'actions',
    name: '작업',
    type: 'text',       // ← type='button' 은 사용 불가 (registry-external)
    cell: ({ row }) => (
      <ButtonCell
        value="편집"
        onClick={() => handleEdit(row.original)}
      />
    ),
    align: 'center',
  },

  // AvatarCell (사용자 이름 + 이미지)
  {
    id: 'user',
    name: '담당자',
    type: 'text',       // ← type='avatar' 는 사용 불가 (registry-external)
    cell: ({ row }) => (
      <AvatarCell name={row.original.userName} src={row.original.avatarUrl} />
    ),
    align: 'left',
  },
]);

사유: onClick (ButtonCell) 과 name (AvatarCell) 이 required prop 으로 row data 단순 lookup 불가. widening cast 를 사용하면 컴파일은 통과하지만 런타임에서 onClick=undefined → TypeError 또는 name=undefined → '?' fallback 이 발생합니다. (ADR-018 D-3 X-B)

License

MIT


Documentation | API Reference