Velocity UI
Loading…
Menu

Installation Guide

Velocity UI supports both an automated CLI workflow and a manual local integration workflow. Use the CLI when you want the fastest setup path, and use the manual approach when your team needs tighter control over file structure, naming, or internal architecture conventions.

The goal of this installation guide is to help you get components running cleanly in development, keep them maintainable in production, and avoid common setup mistakes around aliases, Tailwind configuration, and theme tokens.

Environment Setup

  • Node.js 18+ (20+ recommended)
  • Next.js 14+ App Router
  • Tailwind CSS configured
  • TypeScript enabled
  • A working local development server if you plan to test the registry against your own app

Method 2: Manual Copy & Paste

Manual installation is useful when you want to review free component source before integrating it or when your project uses a custom folder structure. Premium component source is intentionally not exposed in public docs.

  • Browse components in the catalog.
  • Open a free component page and copy the file contents.
  • Create files in src/components/ui (or your preferred folder).
  • Install any listed dependencies.
  • Verify imports, tokens, and peer packages before committing.

Method 3: CDN

A CDN distribution for prebuilt assets is planned. For now, the recommended path is local ownership through CLI install or manual setup so teams can inspect, adapt, and version their UI implementation directly.

Configuration

Path Aliases

Ensure tsconfig.json has an alias for @ pointing to your source folder.

tsconfig.json
{
  "compilerOptions": {
    "baseUrl": ".",
    "paths": {
      "@/*": ["src/*"]
    }
  }
}

Tailwind Setup

Include base styles and tokens in your global CSS.

globals.css
@tailwind base;
@tailwind components;
@tailwind utilities;

Dark Mode

Use next-themes for theme switching.

app/layout.tsx
import { ThemeProvider } from 'next-themes'

<ThemeProvider attribute="class" defaultTheme="light">...</ThemeProvider>

Production Notes

  • Commit installed component files so your build does not depend on a live registry at runtime
  • Audit dependencies before release to keep bundle size and security posture under control
  • Prefer design tokens over hardcoded values so updates scale across the UI system
  • Test light mode, dark mode, keyboard navigation, and responsive layouts before shipping

Build Process

  • Components are normal React/TS files owned by your repo.
  • Tree‑shakeable with your bundler.
  • No runtime registry dependency required in production.

Common Issues

IssueCauseFix
Cannot find moduleMissing tsconfig path aliasAdd @/* alias
Styles not appliedTailwind not configuredInclude base and tokens in globals.css
Dark mode not togglingMissing ThemeProviderWrap with next-themes
Registry add command failsWrong local registry URL or dev server offlineCheck VELOCITY_LOCAL_REGISTRY_URL and restart the app

Platform Notes

  • Windows: Use set VAR=value to define env vars in cmd/PowerShell.
  • macOS/Linux: Use export VAR=value before running the CLI.