Prerequisites
Use an existing React project initialized for shadcn. The CLI reads your components.json and installs files into its configured aliases.
If your project is not initialized yet:
pnpm dlx shadcn@latest initInstall an item
Pass an item's complete registry URL to the CLI. Install the complete foundation collection with:
pnpm dlx shadcn@latest add https://lab.pratikthapw.dev/r/foundation.jsonOr install one item independently:
pnpm dlx shadcn@latest add https://lab.pratikthapw.dev/r/button.jsonThe CLI shows the files and dependencies it will add. Existing files are not silently replaced; review conflicts and diffs before updating a customized component.
Inspect before installing
Use view to inspect the built item or add --dry-run to preview its effect on your project:
pnpm dlx shadcn@latest view https://lab.pratikthapw.dev/r/button.json
pnpm dlx shadcn@latest add https://lab.pratikthapw.dev/r/button.json --dry-runImport the result
import { Button } from "@/components/ui/button";
export function SaveAction() {
return <Button>Save changes</Button>;
}Visit the component page for its full API, composition examples, and boundary notes.