Capítulo 15 de 108
Same three-path pattern (create/CLI/existing). Uses ~/* import alias (like Remix, not @/*), and create-react-router pre-configures Tailwind + the alias automatically.
init -t react-router / --monorepo: standard CLI flags, same as other frameworks.~/* alias: React Router (and Remix) use ~/components/ui/*, distinct from Next/Vite/Astro's @/*.npm create react-router@latest: pre-wires Tailwind CSS and the ~/* alias out of the box.npm create react-router@latest
npx shadcn@latest init
npx shadcn@latest add button
import { Button } from "~/components/ui/button"
export default function Home() {
return (
<div className="flex min-h-svh flex-col items-center justify-center">
<Button>Click me</Button>
</div>
)
}
app/routes/home.tsx usando o alias ~/.@/components/ui/* imports from Next.js examples into a React Router project: wrong alias, use ~/.~/* alias convention with Remix, not the @/* used by Next/Vite/Astro/Laravel.-c apps/web on add, import from @workspace/ui/components/card in apps/web/app/routes/*.~/* alias convention.@/* alias frameworks.