Docs
Setup
Let your agent install blocks for you, run the shadcn CLI, or copy the code. Free blocks need no account.
Pick a way
Requirements
- A React 19 app: Next.js, Vite, TanStack Start or React Router
- Tailwind CSS v4
- shadcn/ui set up in the project (it creates components.json)
- TypeScript, since every block is a .tsx file
Starting from nothing? Follow Install Next.js or Install Vite. They end with a working block on the page.
Add blocks to a project you already have
Set up shadcn/ui, if you haven't
It writes components.json, the cn() helper and the theme colors every block uses.
pnpm dlx shadcn@latest initAdd the @twe registry to components.json, once
This tells the shadcn CLI where @twe/ blocks live. Put it next to the keys already in the file.
{
"registries": {
"@twe": "https://techwithemma.com/r/{name}.json"
}
}Install a block
Every block page shows its own command. This one is free:
pnpm dlx shadcn@latest add @twe/cta-minimal-bannerThe block lands in components/twe-element/cta-minimal-banner.tsx. The CLI also adds the shadcn components it uses, our building blocks like the marquee, and npm packages such as motion.
Match your brand (optional)
Blocks use your shadcn theme colors and radius. Build a theme on the Themes page and it gives you one command that installs it.
Troubleshooting
- Unknown registry "@twe"
- components.json has no
@tweentry. Add the registry from step 2. - "... is a Pro block" (401)
- The CLI sent no token. Add your registry token as shown in Pro blocks.
- "... is part of All-Access" (403)
- Your token works, but the account has no active All-Access plan.
- useState only works in Client Components (Next.js)
- Installed blocks already have it. If you copied the code, add
"use client"as the first line of the block file. See Install Next.js. - The block renders without styles
- Tailwind isn't running on that file. Check that your CSS has @import "tailwindcss" and is loaded by the app.