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 initpnpm dlx @work-rjkashyap/unified-ui initnpx @work-rjkashyap/unified-ui initbunx @work-rjkashyap/unified-ui initAdd 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 --allpnpm 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 --allnpx @work-rjkashyap/unified-ui add button
npx @work-rjkashyap/unified-ui add button card badge tabs dialog
npx @work-rjkashyap/unified-ui add --allbunx @work-rjkashyap/unified-ui add button
bunx @work-rjkashyap/unified-ui add button card badge tabs dialog
bunx @work-rjkashyap/unified-ui add --allThen 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 --overwritepnpm dlx @work-rjkashyap/unified-ui add button --overwritenpx @work-rjkashyap/unified-ui add button --overwritebunx @work-rjkashyap/unified-ui add button --overwriteList & 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 buttonCLI commands reference
| Command | Description |
|---|---|
init | Initialize project config and path aliases |
add <name...> | Add one or more components with dependency resolution |
add --all | Add all available components |
add <name> --overwrite | Overwrite an existing local component |
list | List 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-uipnpm add @work-rjkashyap/unified-uiyarn add @work-rjkashyap/unified-uibun add @work-rjkashyap/unified-uiImport 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
| Feature | npm Package | Copy & Paste CLI |
|---|---|---|
| Installation | npm i @work-rjkashyap/unified-ui | npx @work-rjkashyap/unified-ui add |
| Code location | node_modules/ | Your project (src/components/ui/) |
| Updates | npm update | diff + add --overwrite |
| Customization | Override via className / variants | Edit source directly |
| Bundle size | Tree-shaken by bundler | Only what you add |
| Type safety | Full .d.ts declarations | Full source with types |
| Best for | Teams wanting zero-config consistency | Teams 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.
Alert
5 semantic variants with auto icons, dismissible, collapsible, animated entrance, accessible roles.
Banner
Full-width dismissible announcement banner with top/bottom/inline positioning and slide animation.
Toast
Stackable notifications with 5 positions and action support.
Tooltip
Lightweight info popup with arrow, delay, and 4-side placement.
Progress
Linear progress bar with indeterminate, striped, labeled, and 6 color variants.
Spinner
Animated loading spinner with Framer Motion, 4 sizes, and reduced-motion support.
Empty State
Placeholder for empty lists and views with animated icon, title, description, and CTA slot.
Copy Button
Click-to-copy icon button with clipboard-to-checkmark animation and tooltip.
Sonner
Stacked toast notification system with promise/loading states, built on the sonner library with Unified UI styling.
Overlay (9 components)
Components that render above the page content.
Dialog
Modal dialog with 4 sizes, focus trap, and slot composition.
Alert Dialog
Blocking modal that requires explicit user action. Cannot be dismissed by clicking the overlay.
Confirm Dialog
Pre-composed confirmation dialog with danger variant and loading state.
Sheet
Slide-out panel from any edge with size options.
Popover
Floating content panel with arrow and close button.
Hover Card
Rich preview card on hover with spring animation. Ideal for user profiles and link previews.
Dropdown Menu
Context menu with items, checkboxes, radios, and submenus.
Context Menu
Right-click context menu built on Radix UI.
Drawer
A bottom drawer with native-feeling drag-to-dismiss interaction. Built on vaul with snap points, multiple sizes, and composable slot components.
Navigation (13 components)
Components for moving between views and content sections.
Tabs
3 visual variants with animated indicator and vertical support.
Accordion
Collapsible sections with single/multiple expand modes.
Breadcrumb
Navigation trail with separator, ellipsis, and custom items.
Pagination
Page navigation with smart ellipsis and compact variant.
Collapsible
Animated show/hide section with smooth Framer Motion height transitions.
Scroll Area
Custom scrollbar container for consistent cross-browser scroll appearance.
Navigation Menu
Accessible top-level navigation with dropdown panels and keyboard support.
Menubar
Desktop application-style menubar with nested menus.
Steps
Step indicator for multi-stage flows with active, completed, and upcoming states.
Command
Command palette with fuzzy search, groups, and keyboard navigation.
Sidebar
Collapsible app sidebar with sections, icons, animated width transitions, and mobile overlay.
Tree View
An expandable tree structure with checkable nodes, custom icons, keyboard navigation, and smooth animations.
Infinite Scroll
Scroll-triggered infinite loading with Intersection Observer, loading indicator, and end-of-list detection.
Layout (3 components)
Structural components for building adjustable, responsive layouts.
Separator
Visual divider between content sections with horizontal/vertical orientation, label support, and 4 style variants.
Resizable
Resizable split panels with drag handle for adjustable horizontal and vertical layouts.
Virtual List
A performant virtualized list that only renders visible items, supporting thousands of rows with smooth scrolling.
Utility (2 components)
Low-level building blocks and accessibility helpers.
Visually Hidden
Screen-reader-only content wrapper that hides elements visually while keeping them accessible.
Theme Toggle
A light/dark/system mode switcher with icon and segmented variants. Headless and controlled — works with any theme provider.
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>.