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

create-tanstack-start-shadcn

v1.0.1

Published

Create a TanStack Start app with React Query, shadcn/ui, and Tailwind CSS v4

Readme

create-tanstack-start-shadcn

A CLI to scaffold a TanStack Start application with React Query, shadcn/ui, and Tailwind CSS v4.

Quick Start

# npm
npx create-tanstack-start-shadcn my-app

# yarn
yarn create tanstack-start-shadcn my-app

# pnpm
pnpm create tanstack-start-shadcn my-app

# bun
bun create tanstack-start-shadcn my-app

With Package Manager Flag

Skip the package manager prompt by passing a flag:

npx create-tanstack-start-shadcn my-app --use-pnpm
npx create-tanstack-start-shadcn my-app --use-yarn
npx create-tanstack-start-shadcn my-app --use-bun

What's Included

This starter template comes with a modern, production-ready stack:

Core Framework

UI & Styling

Developer Experience

  • TypeScript - Full type safety
  • TanStack Router Devtools - Debug your routes
  • React Query Devtools - Inspect your queries
  • Vite - Lightning fast HMR

Project Structure

my-app/
├── src/
│   ├── components/       # Reusable UI components
│   │   └── ui/           # shadcn/ui components
│   ├── lib/              # Utility functions
│   ├── routes/           # File-based routes
│   │   ├── __root.tsx    # Root layout
│   │   ├── index.tsx     # Home page (/)
│   │   ├── posts.tsx     # Posts layout (/posts)
│   │   ├── posts.$postId.tsx  # Post detail (/posts/:postId)
│   │   └── ...
│   ├── styles/           # Global styles
│   │   └── app.css       # Tailwind imports
│   └── utils/            # Shared utilities
│       ├── posts.tsx     # Posts data fetching & query options
│       └── users.tsx     # Users data fetching & query options
├── public/               # Static assets
├── components.json       # shadcn/ui config
├── tsconfig.json         # TypeScript config
└── vite.config.ts        # Vite config

Available Scripts

# Start development server
npm run dev

# Build for production
npm run build

# Preview production build
npm run preview

# Start production server
npm run start

Adding shadcn/ui Components

This project uses shadcn/ui for UI components. Add new components with:

npx shadcn@latest add button
npx shadcn@latest add card
npx shadcn@latest add dialog
# etc.

Browse all available components at ui.shadcn.com.

React Query Integration

The starter includes a proper React Query + TanStack Router integration pattern:

Query Options Pattern

// src/utils/posts.tsx
export const postsQueryOptions = () =>
  queryOptions({
    queryKey: ['posts'],
    queryFn: () => fetchPosts(),
  })

Route Loader + Component

// src/routes/posts.tsx
export const Route = createFileRoute('/posts')({
  // Pre-fetch data in loader (SSR compatible)
  loader: ({ context }) =>
    context.queryClient.ensureQueryData(postsQueryOptions()),
  component: PostsComponent,
})

function PostsComponent() {
  // Use the same query options - data is already cached
  const { data: posts } = useSuspenseQuery(postsQueryOptions())
  return <div>{/* render posts */}</div>
}

Customization

Changing the Theme

Edit src/styles/app.css to customize colors, fonts, and other design tokens. The file uses CSS variables that integrate with Tailwind and shadcn/ui.

Adding New Routes

Create a new file in src/routes/:

// src/routes/about.tsx
import { createFileRoute } from '@tanstack/react-router'

export const Route = createFileRoute('/about')({
  component: AboutPage,
})

function AboutPage() {
  return <div>About page</div>
}

The route is automatically registered - no manual configuration needed.

Environment Variables

Create a .env file for environment-specific configuration:

VITE_API_URL=https://api.example.com

Access in code with import.meta.env.VITE_API_URL.

Documentation

License

MIT