Docs
Install Next.js
Start a Next.js app with Tailwind CSS and shadcn/ui, then add your first block.
Create the app
Say yes to TypeScript, Tailwind CSS and the App Router when it asks.
pnpm dlx create-next-app@latest my-appSet up shadcn/ui
Terminal
cd my-apppnpm dlx shadcn@latest initAdd the @twe registry
components.json
{
"registries": {
"@twe": "https://techwithemma.com/r/{name}.json"
}
}Install a block and show it
pnpm dlx shadcn@latest add @twe/cta-minimal-bannerapp/page.tsx
import CtaBanner from "@/components/twe-element/cta-minimal-banner";
export default function Home() {
return <CtaBanner />;
}Run npm run dev and open http://localhost:3000.
Blocks with motion or state
Next.js renders pages on the server by default. A block that animates, opens or tracks a click needs the browser, so its file already starts with "use client" when you install it. Blocks with nothing interactive leave the line out and stay server components.
Your page can stay a server component either way. If you copy a block by hand and Next.js says "useState only works in Client Components", copy the first line too.