Getting started
UI Loft is a library of React components and templates you preview live, then copy into your project. One command adds one to your code.
npx shadcn@latest add https://uiloft.dev/r/glow-button.jsonStart here
Topics
Requirements
A React project with Tailwind CSS and shadcn set up. If shadcn isn't set up yet, run this in your project. It makes a components.json file that says where new files go.
npx shadcn@latest initInstall an item
Every item page shows its own install command. For example, Glow Button:
npx shadcn@latest add https://uiloft.dev/r/glow-button.jsonA component lands in your components folder, here components/glow-button.tsx. A template lands in its own folder, components/<name>/, with its parts and sections inside. Packages the item needs are installed for you. Then import it and use it like any of your own components.
Web apps
A web app installs with the same command. It lands in its own folder, components/<name>/, like a template, and needs the same React, Tailwind and shadcn setup. Packages it needs are installed for you.
No project yet? Start with the Next.js guide: it creates the app and sets up shadcn in about 2 minutes. The Vite and React Router guides work too.
Its pages switch with their own hash links, so one route in your app is enough. To give each page its own URL, move the pages into your router. The app's README shows how.
Plain HTML, CSS and JS
No React? Most items also come as plain HTML, CSS and JS. On the item page, switch Install to HTML. Then copy each file from the Code view, or get them all with Download zip.
Templates ship a plain/ folder too. Open its index.html in a browser to see the page.
Updates and versions
Templates carry a version, like v1.0, shown next to the title on the item page. To update one, run its install command again. shadcn asks before it overwrites a file you already have.
Paid templates
A template you bought installs from the terminal like any item, with your license key. Free items need no key.
Bought a mobile app? It has no install command and needs no key: download it from its page. See the Mobile apps guide.
Your license key
Your first purchase gives you a license key, shown once on the purchase page. One key covers every template you buy. Put it in .env.local, so it stays out of git:
UILOFT_LICENSE_KEY=your-license-keyLost it? Make a new key on your Settings page. The old one stops working.
Add the registry
Add the UI Loft registry to components.json. The CLI sends your key with each request.
{
"registries": {
"@uiloft": {
"url": "https://uiloft.dev/r/{name}.json",
"headers": {
"Authorization": "Bearer ${UILOFT_LICENSE_KEY}"
}
}
}
}Install a template
Install the template by its name:
npx shadcn@latest add @uiloft/sushi-strokeIf the install is refused
The CLI says why:
[License key needed]: the request had no key. Install through@uiloft/, with the registry above and the key in.env.local.[License key not valid]: the key is mistyped or was replaced by a newer one. Copy it again, or make a new one.[Not bought]: your key works, but that template isn't among your purchases, or it was refunded.[Not a terminal install]: that's an app. Download it from its page instead.Failed to fetch from registry (429): too many wrong keys from your network. Wait 10 minutes, then try again with the right key.
Help
Stuck, or found a bug? Get in touch.