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

@wandry/inertia-table

v1.1.1

Published

Production-ready React table component for Laravel + Inertia.js with built-in pagination, sorting, and seamless server-side integration

Readme

Wandry Inertia Table

Production-ready React table component for Inertia.js with TypeScript support. Позволяет быстро создавать таблицы с поддержкой пагинации, сортировки, фильтрации и современных UI-практик (Radix UI, shadcn/ui, Tailwind).

🚀 Быстрый старт

pnpm add @wandry/inertia-table
import { DataTable } from "@wandry/inertia-table";
import type { ColumnDef } from "@tanstack/react-table";

const columns: ColumnDef<{ id: string; name: string; age: number }>[] = [
  { header: "Имя", accessorKey: "name" },
  { header: "Возраст", accessorKey: "age" },
];

const data = [
  { id: "1", name: "Иван Петров", age: 30 },
  { id: "2", name: "Мария Сидорова", age: 25 },
];

<DataTable data={data} columns={columns} />;

📚 Документация

Полная документация доступна в папке docs:

✨ Особенности

  • Простая интеграция с Inertia.js и React
  • TypeScript-first подход
  • Современный UI (Radix UI, shadcn/ui, Tailwind)
  • Пагинация с серверной поддержкой
  • Сортировка и фильтрация (в разработке)
  • Кастомные колонки через базовый ColumnDef
  • Хуки для гибкой работы с состоянием
  • Адаптивный дизайн и доступность

🛠 Установка

# pnpm
pnpm add @wandry/inertia-table

# npm
npm install @wandry/inertia-table

# yarn
yarn add @wandry/inertia-table

Важно: Пакет требует peer-зависимости:

  • react >=19
  • @inertiajs/react >=2
  • @tanstack/react-table >=8
  • @radix-ui/react-select, @radix-ui/react-slot
  • class-variance-authority, clsx, tailwind-merge, lucide-react

📖 Примеры

Простая таблица

import { DataTable } from "@wandry/inertia-table";
import type { ColumnDef } from "@tanstack/react-table";

interface User {
  id: string;
  name: string;
  email: string;
  role: string;
}

const columns: ColumnDef<User>[] = [
  { header: "Имя", accessorKey: "name" },
  { header: "Email", accessorKey: "email" },
  { header: "Роль", accessorKey: "role" },
];

const users: User[] = [
  { id: "1", name: "Иван Петров", email: "[email protected]", role: "Админ" },
  {
    id: "2",
    name: "Мария Сидорова",
    email: "[email protected]",
    role: "Пользователь",
  },
];

export function UsersTable() {
  return <DataTable data={users} columns={columns} />;
}

Таблица с пагинацией

import { DataTable, DataTableFooter } from "@wandry/inertia-table";

const pagination = {
  current_page: 1,
  from: 1,
  last_page: 5,
  per_page: 10,
  to: 10,
  total: 50,
  links: [
    { url: "?page=1", label: "1", active: true },
    { url: "?page=2", label: "2", active: false },
  ],
  path: "/users",
  date: "2024-01-01",
};

export function PaginatedTable() {
  return (
    <div>
      <DataTable data={users} columns={columns} pagination={pagination} />
      <DataTableFooter pagination={pagination} />
    </div>
  );
}

Кастомная колонка

import { ColumnDef } from "@tanstack/react-table";

const columns: ColumnDef<User>[] = [
  { header: "Имя", accessorKey: "name" },
  {
    header: "Действия",
    id: "actions",
    cell: ({ row }) => (
      <button onClick={() => editUser(row.original.id)}>Редактировать</button>
    ),
  },
];

🔧 API

<DataTable />

| Prop | Type | Описание | | --------------- | ------------------------------------------------ | ----------------------------------------------------------------------------------------------- | | data | TData[] | Массив данных для строк | | columns | ColumnDef<TData>[] | Определения колонок (см. tanstack docs) | | pagination? | Pagination | Объект пагинации (см. ниже) | | onRowClick? | (row: TData, index: number) => void | Обработчик клика по строке | | classes? | { table?, header?, head?, body?, row?, cell? } | Кастомные классы для частей таблицы | | emptyMessage? | string | Сообщение при отсутствии данных (по умолчанию: "Нет результатов.") |

<DataTableFooter />

| Prop | Type | Описание | | ------------ | ------------- | ------------------------------------- | | pagination | Pagination? | Объект пагинации | | actions | ReactNode? | Кастомные действия (например, кнопки) |

<DataTablePagination />

| Prop | Type | Описание | | ------------ | ------------- | ---------------- | | pagination | Pagination? | Объект пагинации |

Тип Pagination

type PaginationLink = {
  url: string;
  label: string;
  active: boolean;
};

type Pagination = {
  current_page: number;
  from: number;
  last_page: number;
  links: PaginationLink[];
  path: string;
  per_page: number;
  to: number;
  total: number;
  date: string;
};

🧪 Тестирование

Проект использует Vitest и @testing-library/react:

pnpm test

🔗 Ссылки

📄 Лицензия

ISC