Unified UI

Components

75+ production-ready, accessible React components built on the Unified UI token system.

Overview

Unified UI ships 75+ composite components that compose the design system's tokens, theme, and primitives into production-ready interactive elements. Every component is:

  • Token-driven — All colors, spacing, radii, and motion come from CSS custom properties.
  • Accessible — Built on Radix UI primitives with full WCAG AA compliance.
  • Variant-composed — Uses CVA (class-variance-authority) for type-safe variant APIs.
  • Ref-forwarding — Every component forwards refs for imperative access.
  • Theme-aware — Automatically adapts to light/dark mode via CSS variables.
  • Motion-ready — Framer Motion presets built-in, respecting prefers-reduced-motion.
  • Two distribution modes — Install the npm package or copy individual components with the CLI.

Installation

Unified UI supports two distribution modes — install the full npm package or copy individual components into your project with the CLI. Choose the approach that fits your workflow.

Option A: Copy & Paste CLI

Use the CLI to add individual components to your project. You own the source, can customize freely, and the CLI resolves all dependencies automatically.

Initial setup

Before adding components, initialize your project config and path aliases:

npx @work-rjkashyap/unified-ui init
pnpm dlx @work-rjkashyap/unified-ui init
npx @work-rjkashyap/unified-ui init
bunx @work-rjkashyap/unified-ui init

Add components

Add one or more components by name. The CLI copies the source files into your project and installs any required npm dependencies.

# Add a single component
npx @work-rjkashyap/unified-ui add button

# Add multiple components at once
npx @work-rjkashyap/unified-ui add button card badge tabs dialog

# Add all available components
npx @work-rjkashyap/unified-ui add --all
pnpm dlx @work-rjkashyap/unified-ui add button

pnpm dlx @work-rjkashyap/unified-ui add button card badge tabs dialog

pnpm dlx @work-rjkashyap/unified-ui add --all
npx @work-rjkashyap/unified-ui add button

npx @work-rjkashyap/unified-ui add button card badge tabs dialog

npx @work-rjkashyap/unified-ui add --all
bunx @work-rjkashyap/unified-ui add button

bunx @work-rjkashyap/unified-ui add button card badge tabs dialog

bunx @work-rjkashyap/unified-ui add --all

Then import from your local project:

import { Button } from "@/components/ui/button";
import { Input } from "@/components/ui/input";

Overwrite existing files

If you've previously added a component and want to pull the latest version, use the --overwrite flag:

npx @work-rjkashyap/unified-ui add button --overwrite
pnpm dlx @work-rjkashyap/unified-ui add button --overwrite
npx @work-rjkashyap/unified-ui add button --overwrite
bunx @work-rjkashyap/unified-ui add button --overwrite

List & diff

Check what's available and compare your local files against the registry:

# List all available components in the registry
npx @work-rjkashyap/unified-ui list

# Compare your local component against the latest registry version
npx @work-rjkashyap/unified-ui diff button

CLI commands reference

CommandDescription
initInitialize project config and path aliases
add <name...>Add one or more components with dependency resolution
add --allAdd all available components
add <name> --overwriteOverwrite an existing local component
listList all available registry items
diff <name>Compare local file against the registry version

The CLI automatically resolves and installs all dependencies — other components, utilities, and npm packages. See the CLI docs for the full reference.


Option B: Full npm Package

Use this approach if you prefer a traditional library install. All components are available immediately — no CLI setup required.

npm install @work-rjkashyap/unified-ui
pnpm add @work-rjkashyap/unified-ui
yarn add @work-rjkashyap/unified-ui
bun add @work-rjkashyap/unified-ui

Import the stylesheet in your app's entry point (e.g. layout.tsx or globals.css):

import "@work-rjkashyap/unified-ui/styles.css";

Then import components directly:

import { Button, Input, Card, Dialog } from "@work-rjkashyap/unified-ui";

Or use layer-specific imports for better tree-shaking:

import { Button, Input } from "@work-rjkashyap/unified-ui/components";
import { spacing, radius } from "@work-rjkashyap/unified-ui/tokens";
import { DSThemeProvider } from "@work-rjkashyap/unified-ui/theme";
import { slideUp } from "@work-rjkashyap/unified-ui/motion";
import { cn } from "@work-rjkashyap/unified-ui/utils";

Comparison: CLI vs npm Package

Featurenpm PackageCopy & Paste CLI
Installationnpm i @work-rjkashyap/unified-uinpx @work-rjkashyap/unified-ui add
Code locationnode_modules/Your project (src/components/ui/)
Updatesnpm updatediff + add --overwrite
CustomizationOverride via className / variantsEdit source directly
Bundle sizeTree-shaken by bundlerOnly what you add
Type safetyFull .d.ts declarationsFull source with types
Best forTeams wanting zero-config consistencyTeams wanting full control

Both approaches use the same design tokens and CSS custom properties. You can even mix them — install the package for most components and copy a few that you need to customize heavily.


Component Catalog

Form Controls (21 components)

Interactive elements for capturing user input.

Button

4 variants, 3 sizes, loading state, icon support, polymorphic.

Input

Text input with icons, clearable, error/success validation states.

Input Group

Composed input with prefix/suffix icons and left/right text addons.

Textarea

Multi-line input with auto-resize and character count.

Checkbox

Checkbox with label, description, indeterminate, and group support.

Radio

Radio group with standard and card variants.

Select

Dropdown select with groups, labels, and keyboard navigation.

Switch

Toggle switch with spring animation and label support.

Label

Accessible label with required indicator, sizing, and description text.

Form Field

Composable field wrapper: label + control + description + error message.

Toggle

Pressable on/off button for toolbar actions like bold, italic, mute.

Toggle Group

Single or multi-select group of toggle buttons with roving keyboard nav.

Slider

Range slider with single/dual thumb, step marks, tooltip, and spring animations.

Number Input

Numeric stepper with +/− buttons, keyboard nav, min/max clamping, and digit roll animation.

Pin Input

OTP/PIN code input with auto-advance, paste support, and shake-on-error animation.

Search Input

Search field with debounce, animated clear button, loading state, and keyboard shortcut hint.

Combobox

Searchable select / autocomplete with single and multi-select, grouped options, and animated dropdown.

Date Picker

Date or date-range input with calendar popover, locale formatting, clearable input, and animated transitions.

Calendar

Month/year grid calendar with single and range selection, keyboard navigation, and animated month transitions.

File Upload

Drag-and-drop file upload zone with file list, progress tracking, image preview thumbnails, and stagger animations.

Color Picker

A color selection component with spectrum picker, hue slider, HEX input, and preset swatches.

Data Display (18 components)

Components for presenting information and content.

Badge

8 semantic variants, dot indicator, avatar/icon slots, removable/dismissible, animated entrance, polymorphic.

Avatar

Image with fallback, initials, status dot, and group stacking.

Card

4 variants including interactive, with header/body/footer slots.

Table

Data table with sorting, density options, and alignment.

Data Table

Full-featured table with TanStack Table: sorting, filtering, and pagination.

Skeleton

Loading placeholders in text, circle, and rect shapes.

Stat

KPI card with animated count-up value, trend indicator, and sparkline slot.

Data List

Semantic key-value pair list with horizontal/vertical layouts and stagger animation.

Timeline

Vertical timeline with icons, status colors, and stagger slide animations.

Kbd

Keyboard shortcut display in a styled monospaced element with inset shadow.

Code

InlineCode and CodeBlock with copy button, line numbers, filename, and dark variant.

Carousel

Horizontal/vertical carousel with animated slides, arrows, dots, and autoplay.

Aspect Ratio

Constrains child content to a given aspect ratio. Ideal for images, videos, and responsive media containers.

Chart

A card wrapper for Recharts with consistent design system theming, pre-configured color palette, and responsive sizing.

Data Table Toolbar

A composable toolbar with search, faceted filters, column visibility toggle, and view mode switcher for DataTable.

Image Gallery

A responsive grid of images with an interactive lightbox viewer featuring zoom, keyboard navigation, and thumbnail strip.

Markdown

Renders markdown strings into styled HTML with design system prose styling, supporting headings, lists, code blocks, and more.

Video Player

A styled video component with custom play/pause, mute, seek, and fullscreen controls, poster image, and keyboard shortcuts.

Feedback (9 components)

Components for communicating status and information to users.

Overlay (9 components)

Components that render above the page content.

Components for moving between views and content sections.

Layout (3 components)

Structural components for building adjustable, responsive layouts.

Utility (2 components)

Low-level building blocks and accessibility helpers.


Common Patterns

Variant + Size API

Most components follow a consistent variant + size API powered by CVA:

<Button variant="primary" size="md">Save</Button>
<Input variant="error" size="sm" />
<Badge variant="success" size="md">Active</Badge>
<Badge variant="primary" size="sm" animated>React</Badge>
<Slider variant="primary" size="md" defaultValue={[50]} />

Data Attributes

Every component renders data-ds-* attributes for styling hooks and debugging:

<button
	data-ds
	data-ds-component="button"
	data-ds-variant="primary"
	data-ds-size="md"
>
	Save
</button>

Slot Composition

Complex components use a slot-based pattern with sub-components:

<Card>
	<CardHeader>Title</CardHeader>
	<CardBody>Content</CardBody>
	<CardFooter>
		<Button size="sm">Action</Button>
	</CardFooter>
</Card>

Motion & Reduced Motion

All animated components use Framer Motion presets and respect prefers-reduced-motion automatically:

{/* Animations play normally */}
<Spinner />
<Collapsible />
<PinInput length={6} error />

{/* All animations are automatically disabled when:
    @media (prefers-reduced-motion: reduce) */}

Each component page includes live examples, all variants, props documentation, keyboard interaction tables, motion notes, and accessibility guidelines. When using the copy-paste CLI, each component can be added individually with npx @work-rjkashyap/unified-ui add <name>.