Installation
Add VelocityUI to your project in minutes. Supports npm, yarn, pnpm, and bun.
Requirements
| Dependency | Version |
|---|---|
| react | ≥ 18.0.0 |
| react-dom | ≥ 18.0.0 |
| node | ≥ 18.0.0 |
Install
Install the package
npm install @velocityuikit/velocityuiImport the stylesheet
Import the CSS file once at the root of your application. In Next.js App Router this is your root layout.tsx. In Vite projects, add it to main.tsx.
import '@velocityuikit/velocityui/dist/style.css'Start using components
Import any component directly from the package — no provider or global setup required.
import { Button, Input, Card } from '@velocityuikit/velocityui'
export default function App() {
return (
<Card>
<Input placeholder="Your email" />
<Button>Subscribe</Button>
</Card>
)
}Framework setup
Next.js (App Router)
Import the stylesheet in your root layout. Components work in both Server and Client Components — interactive ones (Dialog, Dropdown, etc.) are already marked 'use client' internally.
// app/layout.tsx
import '@velocityuikit/velocityui/dist/style.css'
import type { Metadata } from 'next'
export const metadata: Metadata = {
title: 'My App',
}
export default function RootLayout({ children }: { children: React.ReactNode }) {
return (
<html lang="en">
<body>{children}</body>
</html>
)
}Next.js (Pages Router)
// pages/_app.tsx
import '@velocityuikit/velocityui/dist/style.css'
import type { AppProps } from 'next/app'
export default function App({ Component, pageProps }: AppProps) {
return <Component {...pageProps} />
}Vite + React
// src/main.tsx
import React from 'react'
import ReactDOM from 'react-dom/client'
import '@velocityuikit/velocityui/dist/style.css'
import App from './App'
ReactDOM.createRoot(document.getElementById('root')!).render(
<React.StrictMode>
<App />
</React.StrictMode>
)Remix
// app/root.tsx
import velocityStyles from '@velocityuikit/velocityui/dist/style.css?url'
import type { LinksFunction } from '@remix-run/node'
export const links: LinksFunction = () => [
{ rel: 'stylesheet', href: velocityStyles },
]CDN (no build step)
For quick prototypes or environments without a bundler, you can load VelocityUI from a CDN. Note: this approach does not support tree-shaking.
<!-- CSS -->
<link
rel="stylesheet"
href="https://cdn.jsdelivr.net/npm/@velocityuikit/velocityui@latest/dist/style.css"
/>
<!-- ES Module (modern browsers) -->
<script type="module">
import { Button } from 'https://cdn.jsdelivr.net/npm/@velocityuikit/velocityui@latest/dist/index.js'
</script>TypeScript
VelocityUI is written in TypeScript and ships with full type definitions — no @types package needed. All component props, variants, and callbacks are typed.
import { Button } from '@velocityuikit/velocityui'
import type { ButtonProps } from '@velocityuikit/velocityui'
function MyButton(props: ButtonProps) {
return <Button {...props} />
}Verify your install
Drop this snippet anywhere in your app. If you see a styled button, everything is wired up correctly.
import { Button } from '@velocityuikit/velocityui'
export default function Test() {
return (
<Button onClick={() => alert('VelocityUI is working!')}>
Hello VelocityUI
</Button>
)
}