Laravel
Install newt/ui in a Laravel app running Inertia, with either the React or the Vue starter kit.
Choose the brand hue, the radius and the font in newt/create, and it prints a preset code. Pass that code to init and the project comes out already wearing it.
pnpm dlx laravel newnpx laravel newyarn dlx laravel newbunx laravel newpnpm dlx newtui@latest init --preset <code>npx newtui@latest init --preset <code>yarn dlx newtui@latest init --preset <code>bunx newtui@latest init --preset <code>pnpm dlx newtui@latest add buttonnpx newtui@latest add buttonyarn dlx newtui@latest add buttonbunx newtui@latest add buttonLaravel has no scaffold template, so the project is created by its own tool first and init runs inside the result. It detects the framework, the bundler and the stylesheet on its own.
pnpm dlx laravel newnpx laravel newyarn dlx laravel newbunx laravel newpnpm dlx newtui@latest initnpx newtui@latest inityarn dlx newtui@latest initbunx newtui@latest initpnpm dlx newtui@latest add buttonnpx newtui@latest add buttonyarn dlx newtui@latest add buttonbunx newtui@latest add buttonCreate the app
laravel new my-app --reactlaravel new my-app --vueThe Inertia starter kits ship Vite and Tailwind v4 already wired, which is the
part init cannot do for you.
Declare the alias twice
{
"compilerOptions": {
"paths": { "@/*": ["./resources/js/*"] }
}
}import { fileURLToPath } from "node:url"
import laravel from "laravel-vite-plugin"
import { defineConfig } from "vite"
export default defineConfig({
plugins: [
laravel({ input: ["resources/css/app.css", "resources/js/app.tsx"] }),
],
resolve: {
alias: { "@": fileURLToPath(new URL("./resources/js", import.meta.url)) },
},
})Run init
pnpm dlx newtui@latest init --framework react --css resources/css/app.cssnpx newtui@latest init --framework react --css resources/css/app.cssyarn dlx newtui@latest init --framework react --css resources/css/app.cssbunx newtui@latest init --framework react --css resources/css/app.csspnpm dlx newtui@latest init --framework vue --bundler vite --css resources/css/app.cssnpx newtui@latest init --framework vue --bundler vite --css resources/css/app.cssyarn dlx newtui@latest init --framework vue --bundler vite --css resources/css/app.cssbunx newtui@latest init --framework vue --bundler vite --css resources/css/app.cssThere is no --template for Laravel: the app comes from laravel new, and
init runs inside it. --css points at the stylesheet the Blade layout
already loads.
Mark the root layout
<body class="newt-root font-sans antialiased">
@inertia
</body>Add a component
pnpm dlx newtui@latest add buttonnpx newtui@latest add buttonyarn dlx newtui@latest add buttonbunx newtui@latest add buttonimport { Button } from "@/components/ui/button"
export default function Welcome() {
return <Button variant="primary">Send</Button>
}<script setup lang="ts">
import { Button } from "@/components/ui/button"
</script>
<template>
<Button variant="primary">Send</Button>
</template>Blade without Inertia
An app that renders Blade templates and no JavaScript framework wants the plain CSS flavour instead: two stylesheets, BEM class names, no build step beyond the one Vite already runs. That is HTML & CSS.
What init writes
components.json the config, shared with shadcn
resources/css/app.css the --newt-* token block
resources/js/lib/utils.ts cn()
resources/js/components/ui/button.tsx add button (React)
See Dark mode for the theme toggle, and RTL if the app has to run right to left.