Docs / Frameworks
React Router
Add UI Loft items to a React Router app in framework mode. New apps come with Tailwind and an import alias, so it's three commands.
- Version
- React
- Needs
- Tailwind 4 + shadcn
- Setup time
- About 2 minutes
Set up
Create the app
Skip this if you already have one.
--yestakes the defaults.Terminalnpx create-react-router@latest my-app --yes cd my-appSet up shadcn
It makes a
components.jsonthat says where new files go.-dtakes the defaults.Terminalnpx shadcn@latest init -dAdd an item
Copy the command from any item page. The file lands in
app/components/.Terminalnpx shadcn@latest add https://uiloft.dev/r/glow-button.jsonUse it
Import it in a route.
app/routes/home.tsximport { GlowButton } from "~/components/glow-button" export default function Home() { return <GlowButton>Get started</GlowButton> }
Good to know
- Imports start with
~/, not@/. shadcn changes the item's own imports to match. - An older or hand-made app needs Tailwind 4 and the
~/*path alias before Set up shadcn. - These steps were checked with React Router 8.