Laravel
Add PanelUI web components to a Laravel app with the React starter kit.
For Laravel with Inertia and React.
A new project
Create the project
Create the app with the React starter kit, then run the shadcn CLI inside it:
laravel new my-appnpx shadcn@latest initpnpm dlx shadcn@latest inityarn dlx shadcn@latest initbunx shadcn@latest initAdd a component
npx shadcn@latest add https://panelui.dev/r/web/rolling-number.jsonpnpm dlx shadcn@latest add https://panelui.dev/r/web/rolling-number.jsonyarn dlx shadcn@latest add https://panelui.dev/r/web/rolling-number.jsonbunx shadcn@latest add https://panelui.dev/r/web/rolling-number.jsonThe source is written to components/panelui/rolling-number.tsx, and the packages it uses are
installed for you.
Use it
import { RollingNumber } from "@/components/panelui/rolling-number"
export default function Index() {
return (
<main className="flex min-h-svh items-center justify-center">
<RollingNumber value={121} className="text-6xl font-semibold" />
</main>
)
}An existing project
Run the CLI in the project. It adds the theme tokens to your CSS and writes components.json:
npx shadcn@latest initpnpm dlx shadcn@latest inityarn dlx shadcn@latest initbunx shadcn@latest initThen add a component as in the steps above.
From npm
To install the package instead of copying source, follow From npm once the project has its shadcn theme.