This quickstart guide walks you through adding Shaddy resources — UI components, typed hooks, and the form system — to an existing Next.js project. By the end you will have a working form backed by Zod validation, installed entirely without adding a new package dependency.Documentation Index
Fetch the complete documentation index at: https://mintlify.com/rijvi-mahmud/shaddy/llms.txt
Use this file to discover all available pages before exploring further.
Prerequisites
Before adding any Shaddy resource, make sure your project meets the following requirements:- Node.js >= 20 (enforced by Shaddy’s own
enginesfield) - A Next.js project (App Router recommended, matching Next.js 15)
- shadcn/ui initialized in your project (
npx shadcn@latest init) - TypeScript configured (Shaddy resources are fully typed)
- Tailwind CSS set up in your project
If you haven’t initialized shadcn/ui yet, run
npx shadcn@latest init in your project root and follow the prompts before continuing.How Shaddy Works
Shaddy does not publish an npm package. Instead, it hosts a public shadcn-compatible registry at:npx shadcn@latest add <url> CLI you already use for shadcn/ui components. The CLI fetches the resource from the registry and copies it directly into your codebase — you own the code, and you can customize it however you like.
Step-by-Step Setup
Ensure shadcn/ui is initialized
If you haven’t already, initialize shadcn/ui in your Next.js project. This sets up the
components/ui directory, your tailwind.config, and the cn utility that Shaddy resources depend on.Add the Shaddy Form System
The This copies the following files into your project:
shaddy-form registry item installs the ShaddyForm component along with its dependencies (form, input, button, and supporting field primitives from shadcn/ui).Add a Typed Hook
Hooks are added individually. Here’s how to add This copies
useBoolean, a fully-typed boolean state manager:hooks/use-boolean.ts into your project.Add a UI Component
UI components are added the same way. For example, to add the This copies
Stepper component:components/ui/stepper.tsx and any required shadcn/ui peer components into your project.Install any additional dependencies
Some Shaddy resources declare additional npm dependencies. The These packages are required by the
shadcn CLI will prompt you to install them automatically. If you need to install them manually, use your preferred package manager:ShaddyForm component, which wires react-hook-form and Zod together behind a clean generic API.Build your first form
With
ShaddyForm copied into your project, you can build a validated form in just a few lines. Here is a minimal working example:ShaddyForm is fully generic — TypeScript infers the field types from your Zod schema automatically, giving you type-safe access to form values in onSubmit with no extra type annotations needed.Using the useBoolean Hook
Once hooks/use-boolean.ts is in your project, import and use it like this:
[value, controls], where controls exposes toggle, setTrue, setFalse, reset, setValue, and getValue — all correctly typed.
Registry Reference
All Shaddy resources follow the same URL pattern:| Resource | Command |
|---|---|
| Form system | npx shadcn@latest add https://shaddy-docs.vercel.app/r/shaddy-form |
| useBoolean hook | npx shadcn@latest add https://shaddy-docs.vercel.app/r/use-boolean |
| Stepper component | npx shadcn@latest add https://shaddy-docs.vercel.app/r/stepper |
| Date Range Picker | npx shadcn@latest add https://shaddy-docs.vercel.app/r/date-range-picker |
| Loading Spinner | npx shadcn@latest add https://shaddy-docs.vercel.app/r/loading-spinner |