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

auto-thing-zod

v0.0.6

Published

Auto-generate typed t3 stack crud

Readme

auto-thing-zod

A powerful, customizable React component library for quickly creating CRUD interfaces with automatic Zod schema integration.

Features

  • 🚀 Zero Config CRUD: Auto-generate full CRUD interfaces from your Zod schemas
  • 🔍 Search and Filtering: Built-in search functionality with custom filters
  • 📱 Responsive: Mobile-friendly interfaces out of the box
  • 🎨 Customizable: Override any component with your own implementation
  • 🛠️ tRPC Integration: Seamless integration with tRPC for type-safe API routes
  • 📊 Data Tables: Advanced tables with sorting, pagination, and more

Installation

npm install auto-thing-zod zod-auto-form raw-auto-table-zod zod-helper
# or
yarn add auto-thing-zod zod-auto-form raw-auto-table-zod zod-helper
# or
pnpm add auto-thing-zod zod-auto-form raw-auto-table-zod zod-helper

Default Components

You can quickly get started with the default shadcn/ui components:

Auto Thing Components

# Using npm
npx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-thing-component.json

# Using pnpm
pnpm dlx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-thing-component.json

# Using Bun
bunx --bun shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-thing-component.json

Auto Form Components

# Using npm
npx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-form-component.json

# Using pnpm
pnpm dlx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-form-component.json

# Using Bun
bunx --bun shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-form-component.json

Auto Table Components

# Using npm
npx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-table-component.json

# Using pnpm
pnpm dlx shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-table-component.json

# Using Bun
bunx --bun shadcn@latest add https://raw.githubusercontent.com/atul7017128880/component-registry/refs/heads/master/public/registry/auto-table-component.json

Quick Start

import { AutoCrud } from "auto-thing-zod";
import { z } from "zod";
import { api } from "@/trpc/react"; // Your tRPC setup
import { toast } from "sonner"; // Or your preferred toast library

// Define your schema with Zod
const userSchema = z.object({
  id: z.number(),
  name: z.string(),
  email: z.string().email(),
  // Add more fields as needed
});

function MyComponent() {
  return (
    <AutoCrud
      schema={userSchema}
      trpcApiRoutes={api.user}
      ToastFunction={(message, type) => {
        toast(message, { description: type });
      }}
    />
  );
}

Core Components

AutoCrud

The main component for generating complete CRUD interfaces:

<AutoCrud
  // Required props
  schema={zodSchema}
  trpcApiRoutes={api.post}
  ToastFunction={(message, type) => {
    toast(message, { description: type });
  }}
  
  // Optional configurations
  loadingType="row-based"
  sizeOfLoadingRows={10}
  hideSubmitButtonOfEditModal={false}
  hideCreateModalSubmitButton={false}
  disableCreateRow={false}
  disableEditRow={false}
  disableDeleteRow={false}
  disableViewRow={false}
  
  // Optional callbacks
  onDeleteSubmit={async (data) => {/* ... */}}
  onEditSubmit={async (data) => {/* ... */}}
  onCreateSubmit={async (data) => {/* ... */}}
  onRowClick={async (data) => {/* ... */}}
  
  // Optional custom schemas
  createSchema={customCreateSchema}
  
  // Optional UI customizations
  title="Users Table"
  description="Manage system users"
/>

AutoThingTable

Lower-level table component with more granular control:

<AutoThingTable
  data={users}
  schema={userSchema}
  isLoading={isLoading}
  currentPage={page}
  totalPage={totalPages}
  onPageChange={(newPage) => setPage(newPage)}
  canGoToNextPage={hasNextPage}
  canGoToPreviousPage={hasPrevPage}
  isActionColumnComponentEnabled={true}
  actionColumnComponent={({ row }) => (
    // Your custom action buttons
  )}
/>

Provider Setup

To use custom components, wrap your application with the necessary providers:

import { AutoFormComponentsProvider } from "zod-auto-form";
import { AutoTableComponentsProvider } from "raw-auto-table-zod";
import { AutoThingComponentsProvider } from "auto-thing-zod";
import componentRegistry from "@/components/ui/auto-form";
import AutoTableRegistryComponents from "@/components/ui/auto-table";

function App() {
  return (
    <AutoFormComponentsProvider components={componentRegistry}>
      <AutoTableComponentsProvider components={AutoTableRegistryComponents}>
        <AutoThingComponentsProvider
          components={{
            DeleteModal: CustomDeleteModal,
            EditModal: CustomEditModal,
            ViewModal: CustomViewModal,
            // ... other component overrides
          }}
        >
          {/* Your application */}
        </AutoThingComponentsProvider>
      </AutoTableComponentsProvider>
    </AutoFormComponentsProvider>
  );
}

tRPC Integration

Set up your tRPC router with the ZodPrismaClassed helper:

import { z } from "zod";
import { createTRPCRouter, publicProcedure } from "@/server/api/trpc";
import { db } from "@/server/db";
import { ZodPrismaClassed } from "zod-helper";

// Define your schema
const userSchema = z.object({
  id: z.number(),
  name: z.string(),
  email: z.string().email(),
  // ...other fields
});

// Create ZodPrisma instance
const zodPrisma = new ZodPrismaClassed(userSchema);

// Generate CRUD routes
export const userRouter = zodPrisma.getCrudRoutesTRPC({
  createTRPCRouter,
  procedure: publicProcedure,
  delegate: db.user,
});

Customization

Custom Components

You can override any component by providing it through the AutoThingComponentsProvider:

<AutoThingComponentsProvider
  components={{
    DeleteModal: CustomDeleteModal,
    EditModal: CustomEditModal,
    ViewModal: CustomViewModal,
    ActionButtonWrapper: CustomActionButtonWrapper,
    ViewButtonDetails: CustomViewButtonDetails,
    EditButtonDetails: CustomEditButtonDetails,
    DeleteButtonDetails: CustomDeleteButtonDetails,
    TableWrapperCard: CustomTableWrapperCard,
    CreateModal: CustomCreateModal,
    SearchFilterWrapper: CustomSearchFilterWrapper,
  }}
>
  {/* ... */}
</AutoThingComponentsProvider>

Custom Route Handlers

You can replace the default API routes with your own implementations:

<AutoCrud
  // ...other props
  replaceRoutes={{
    create: api.customEntity.create,
    update: api.customEntity.update,
    delete: api.customEntity.delete,
    search: api.customEntity.search,
  }}
/>

Field Ordering

Change the order of fields in your forms and tables:

<AutoCrud
  // ...other props
  changePositionOfFields={{
    nested: {
      age: {
        position: 0,
      },
      name: {
        position: 1,
      },
    },
  }}
/>

Advanced Usage

Custom Search Parameters

Set default search parameters:

<AutoCrud
  // ...other props
  defaultSearchValues={{
    limit: 10,
    page: 1,
    searchBy: "name",
    sortBy: "createdAt",
    sortOrder: "desc",
  }}
/>

Custom Columns

Add additional columns or replace existing ones:

<AutoCrud
  // ...other props
  extraCustomColumns={[
    {
      id: "actions",
      header: "Custom Actions",
      cell: ({ row }) => (
        // Your custom cell content
      ),
    },
  ]}
  isExtraCustomColumnsEnabled={true}
  replaceColumns={[
    // Replace default columns with custom implementations
  ]}
/>

License

MIT