Migration steps
Migration steps in the Migrating from shadcn/ui and Radix guide.
- Install
@shadow-js/primitivesnext to@shadow-js/coreand@shadow-js/web. Copy the helpers in The shadcn helpers tosrc/lib/utils.ts. - For each shadcn file, replace
import * as XPrimitive from "@radix-ui/react-x"withimport { X as XPrimitive } from "@shadow-js/primitives". The part names are the same. - Delete
React.forwardRefanddisplayName; takepropsand spreadmergeElementProps({ class: "..." }, props). - Rename
classNametoclassandasChildtoas. - Replace
lucide-reacticons with inline SVG components (or any SVG library that renders elements). - Replace
cvaandcnwithvariantsandcnfromsrc/lib/utils.ts, or keepclass-variance-authority,clsxandtailwind-mergeif you install them: they are plain functions that return strings. is synchronous, and outside presses needfireEvent.pointerDown. - Run the Tailwind setup from Tailwind.