Skip to content

Installation

Astro

Install newt/ui in an Astro site, where React and Vue components can live side by side as islands.

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.

npx create astro@latestpnpm dlx create astro@latestyarn dlx create astro@latestbunx create astro@latestdeno run -A npm:create astro@latestvlx create astro@latestvp dlx create astro@latestnubx create astro@latestnlx create astro@latestupx create astro@latest
npx newtui@latest init --preset <code>pnpm dlx newtui@latest init --preset <code>yarn dlx newtui@latest init --preset <code>bunx newtui@latest init --preset <code>deno run -A npm:newtui@latest init --preset <code>vlx newtui@latest init --preset <code>vp dlx newtui@latest init --preset <code>nubx newtui@latest init --preset <code>nlx newtui@latest init --preset <code>upx newtui@latest init --preset <code>
npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

Astro 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.

npx create astro@latestpnpm dlx create astro@latestyarn dlx create astro@latestbunx create astro@latestdeno run -A npm:create astro@latestvlx create astro@latestvp dlx create astro@latestnubx create astro@latestnlx create astro@latestupx create astro@latest
npx newtui@latest initpnpm dlx newtui@latest inityarn dlx newtui@latest initbunx newtui@latest initdeno run -A npm:newtui@latest initvlx newtui@latest initvp dlx newtui@latest initnubx newtui@latest initnlx newtui@latest initupx newtui@latest init
npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

Create the site and add a framework

npm create astro@latest my-site
npx astro add react
npx astro add vue

Both integrations can be installed at once. This site runs them together: the switcher at the top of the page decides which island paints, and the other one’s markup is hidden rather than unmounted.

Add Tailwind

npx astro add tailwind
@import "tailwindcss";

Declare the alias

{
  "compilerOptions": {
    "paths": { "@/*": ["./src/*"] }
  }
}

Astro resolves tsconfig paths on its own, so there is no second copy to keep in the Vite config.

Run init

npx newtui@latest init --framework reactpnpm dlx newtui@latest init --framework reactyarn dlx newtui@latest init --framework reactbunx newtui@latest init --framework reactdeno run -A npm:newtui@latest init --framework reactvlx newtui@latest init --framework reactvp dlx newtui@latest init --framework reactnubx newtui@latest init --framework reactnlx newtui@latest init --framework reactupx newtui@latest init --framework react
npx newtui@latest init --framework vue --bundler vitepnpm dlx newtui@latest init --framework vue --bundler viteyarn dlx newtui@latest init --framework vue --bundler vitebunx newtui@latest init --framework vue --bundler vitedeno run -A npm:newtui@latest init --framework vue --bundler vitevlx newtui@latest init --framework vue --bundler vitevp dlx newtui@latest init --framework vue --bundler vitenubx newtui@latest init --framework vue --bundler vitenlx newtui@latest init --framework vue --bundler viteupx newtui@latest init --framework vue --bundler vite

A site with both integrations has both frameworks in its dependencies, so name the one you want the components written for. Running init twice with different --framework values is fine: the tokens are written once and skipped after that.

Load the stylesheet and mark the root

---
import "../styles/global.css"
---

<html lang="en">
  <body class="newt-root">
    <slot />
  </body>
</html>

Add a component

npx newtui@latest add buttonnpx shadcn@latest add @newtui/buttonnpx shadcn-vue@latest add @newtui/buttonpnpm dlx newtui@latest add buttonpnpm dlx shadcn@latest add @newtui/buttonpnpm dlx shadcn-vue@latest add @newtui/buttonyarn dlx newtui@latest add buttonyarn dlx shadcn@latest add @newtui/buttonyarn dlx shadcn-vue@latest add @newtui/buttonbunx newtui@latest add buttonbunx shadcn@latest add @newtui/buttonbunx shadcn-vue@latest add @newtui/buttondeno run -A npm:newtui@latest add buttondeno run -A npm:shadcn@latest add @newtui/buttondeno run -A npm:shadcn-vue@latest add @newtui/buttonvlx newtui@latest add buttonvlx shadcn@latest add @newtui/buttonvlx shadcn-vue@latest add @newtui/buttonvp dlx newtui@latest add buttonvp dlx shadcn@latest add @newtui/buttonvp dlx shadcn-vue@latest add @newtui/buttonnubx newtui@latest add buttonnubx shadcn@latest add @newtui/buttonnubx shadcn-vue@latest add @newtui/buttonnlx newtui@latest add buttonnlx shadcn@latest add @newtui/buttonnlx shadcn-vue@latest add @newtui/buttonupx newtui@latest add buttonupx shadcn@latest add @newtui/buttonupx shadcn-vue@latest add @newtui/button

The shadcn CLI needs the @newtui registry in your components.json. Set it up.

An interactive component is an island, so it needs a client: directive. A static one does not.

---
import { Button } from "@/components/ui/button"
---

<Button client:load variant="primary">Send</Button>
---
import { Button } from "@/components/ui/button"
---

<Button client:load variant="primary">Send</Button>

What init writes

components.json                 the config, shared with shadcn
src/styles/global.css           the --newt-* token block
src/lib/utils.ts                cn()
src/components/ui/button.tsx    add button (React)

The Vue flavour writes a folder per component instead — Button.vue plus an index.ts barrel.

Two frameworks in one site

Nothing stops a site from carrying both registries: they share the same --newt-* tokens, so a React island and a Vue island rendered next to each other are indistinguishable. Keep them in separate directories — components/ui for one and components/ui-vue for the other — and point components.json at whichever you are adding to at the time.

See Dark mode for the theme toggle, and RTL if the site has to run right to left.