Installation
Requirements
Start in an existing React 19 and TypeScript app with CSS imports, an ES2020 or newer target, and Node.js 22.14 or newer for the CLI.
Tailwind CSS and shadcn/ui are optional. Installed components include their own stylesheet.
Quick start
Run these commands from your app root. @naminc/vnui provides the vnui installer; it copies source into your project.
1. Initialize the destination
The CLI creates vnui.json and resolves any existing TypeScript or shadcn component alias.
npx @naminc/vnui@latest init2. Add a component
This copies Phone Input and its shared files. Run list to see all eight component names.
npx @naminc/vnui@latest add phone-input3. Import and render
In src/App.tsx, with the default src/components/vnui destination, import the copied file:
import { useState } from "react"; import { PhoneInput } from "./components/vnui/components/phone-input"; export function App() { const [phone, setPhone] = useState(""); return <PhoneInput value={phone} onValueChange={setPhone} />; }
For a Next.js App Router file using state, add "use client"; as its first line. Adjust the import to match vnui.json if your alias or directory differs.
Configuration
The installed TypeScript, CSS and data belong to your app. Edit the source or the --vn-input, --vn-ink, --vn-border and --vn-focus CSS variables. Existing edited files require confirmation before replacement; use --overwrite only when intended. Pass --cwd to select another app directory.
If you moved a pnpm app after installing dependencies, run pnpm install in its new location before add. Maintainers can find local pack and repository setup in the contribution guide. Contribution guide