Docs / Frameworks
Next.js
Add UI Loft items to a Next.js app with the shadcn CLI. You set up once, then every item is one command.
- Version
- React
- Needs
- Tailwind 4 + shadcn
- Setup time
- About 2 minutes
Set up
Create the app
Skip this if you already have one. shadcn's Next.js template comes with TypeScript, Tailwind, the App Router and the Geist font set up.
Terminalnpx shadcn@latest init -t next -n my-app -d cd my-appAlready have an app? Set up shadcn
It makes a
components.jsonthat says where new files go. If yourapp/layout.tsxcame from create-next-app, change--font-geist-sansto--font-sansthere, or text shows in a serif font.Terminalnpx shadcn@latest init -dAdd an item
Copy the command from any item page. The file lands in
components/.Terminalnpx shadcn@latest add https://uiloft.dev/r/glow-button.jsonUse it
Import it in any page. It works in a Server Component page as is.
app/page.tsximport { GlowButton } from "@/components/glow-button" export default function Page() { return <GlowButton>Get started</GlowButton> }
Good to know
- Items that move or react to you already start with
"use client". You don't add it yourself. - With
--src-dir, files land insrc/components/and the import stays@/components/glow-button. - To update an item, run its command again. shadcn asks before it overwrites a file.