Get started
Installation
Install the package, import its stylesheet once, and start using components. It takes about two minutes.
Requirements
- React 19, and the matching
react-dom. They're peer dependencies, so the library uses your app's copy. - A bundler that can import CSS, such as Vite, Next.js, webpack or the Angular CLI.
Install the package
npm install @vjdesigns/vjdesigns-ui
Starting a new project without React? Add it in the same command: npm install @vjdesigns/vjdesigns-ui react react-dom.
Import the styles
The component styles and design tokens ship as one stylesheet. Import it once, at your app's entry point. Without it, components render unstyled.
import "@vjdesigns/vjdesigns-ui/dist/vjdesigns-ui.css";
Load the fonts
The library sets headings and controls in Archivo, body text in DM Sans and code in JetBrains Mono. The fonts aren't bundled, so you choose how to load them. Without them, the type falls back to system fonts and still looks clean. To get the intended look, add this to your HTML <head>:
<link rel="preconnect" href="https://fonts.googleapis.com" />
<link rel="preconnect" href="https://fonts.gstatic.com" crossorigin />
<link
rel="stylesheet"
href="https://fonts.googleapis.com/css2?family=Archivo:wght@500;600;700;800&family=DM+Sans:wght@400;500;600&family=JetBrains+Mono:wght@400;500&display=swap"
/>
Use your first component
Import components from the package root. Unused components are tree-shaken out of your bundle.
import { useState } from "react";
import { Button, CheckBox } from "@vjdesigns/vjdesigns-ui";
import "@vjdesigns/vjdesigns-ui/dist/vjdesigns-ui.css";
export function SignupForm() {
const [accepted, setAccepted] = useState(false);
return (
<form>
<CheckBox
label="Accept terms"
checked={accepted}
onCheckedChange={setAccepted}
/>
<Button tone="primary" disabled={!accepted}>
Create account
</Button>
</form>
);
}
Controlled or uncontrolled
value / onValueChange (or checked / onCheckedChange, open / onOpenChange) for controlled use, or a default… prop to let the component manage its own state. Change callbacks receive the new value, not an event.Framework setup
Router links
Link, Button, Navbar.Link, Navbar.Brand and Breadcrumbs.Item take an as prop. Pass your router's link component and its props (such as to) are accepted and typed:
import { Link as RouterLink } from "react-router-dom";
import { Button, Link } from "@vjdesigns/vjdesigns-ui";
<Link as={RouterLink} to="/pricing">See pricing</Link>
<Button as={RouterLink} to="/signup" tone="primary">Get started</Button>
Next.js App Router
The components use React state and effects, so in the App Router they render inside Client Components. Import them from a file that starts with "use client", and import the stylesheet in your root layout.tsx.
"use client";
import { Button } from "@vjdesigns/vjdesigns-ui";
export function SaveButton() {
return <Button onClick={() => console.log("Saved")}>Save</Button>;
}
Angular and Vue
See Angular & Vue for wrapper components that mount the React components in those frameworks.
TypeScript
Types ship with the package; there's nothing extra to install. Every component's props type is exported (ButtonProps, CardProps…), along with the shared vocabulary used across components: Size, Tone, Radius, Placement and Orientation.
import { Badge, type Size, type Tone } from "@vjdesigns/vjdesigns-ui";
// Reuse the library's vocabulary in your own components.
type StatusProps = { label: string; tone?: Tone; size?: Size };
export function Status({ label, tone = "success", size = "md" }: StatusProps) {
return <Badge tone={tone} size={size} dot>{label}</Badge>;
}