Skip to main content

Getting Started

Welcome to RizzUI - A modern, minimal React UI library built with Tailwind CSS v4 and React 19. Get production-ready components that are intuitive, accessible, and performant.

Features

  • 50+ Components - Comprehensive set of UI components including buttons, forms, modals, and more
  • Tailwind CSS v4 - Modern CSS-first configuration without JavaScript config files
  • Dark Mode Ready - Built-in dark mode support using OKLCH color space
  • Fully Accessible - WCAG compliant components built on Headless UI primitives
  • Tree-shakeable - Optimized bundle size - only ship what you use
  • TypeScript Native - Complete type safety and IntelliSense support

Prerequisites

Before you begin, make sure you have:

  • React 19.1.0 or higher
  • Node.js 18.0.0 or higher
  • Package Manager: pnpm 9.0+ (recommended), npm, yarn, or bun

Installation

Step 1

Install RizzUI & Core Dependencies

Navigate to your React/Next.js project and run:

npm i rizzui @headlessui/react @floating-ui/react tailwind-variants tailwind-merge

Package Overview - rizzui - The core UI component library - @headlessui/react - Provides accessible, unstyled primitives for complex components (dropdowns, modals, tabs) - @floating-ui/react - Advanced positioning system for tooltips, popovers, and dropdowns - tailwind-variants - Type-safe variant management system for component styling - tailwind-merge - A utility for merging Tailwind CSS classes

Step 2

Install Tailwind CSS & Forms Plugin

Install these development dependencies for styling:

npm i -D tailwindcss @tailwindcss/forms @tailwindcss/postcss

Development Dependencies - tailwindcss - The core Tailwind CSS v4 framework - @tailwindcss/forms - Enhanced form styling with consistent, accessible input designs - @tailwindcss/postcss - Tailwind CSS v4 PostCSS processing engine

Configuration

Step 3

Configure Your Styles

Tailwind CSS v4 uses a modern CSS-first configuration approach. No tailwind.config.js file is required.

Create or update your app/globals.css (or src/app/globals.css for Next.js):

/* Import Tailwind CSS v4 */
@import 'tailwindcss';

/* Configure content sources for RizzUI components */
@source '../node_modules/rizzui/dist';

/* Enable enhanced form styles */
@plugin '@tailwindcss/forms';

/* Define color palette using OKLCH color space */
:root {
/* Base Colors */
--background: oklch(100% 0 0);
--foreground: oklch(40.17% 0 0);
--muted: oklch(91.58% 0 0);
--muted-foreground: oklch(66% 0 0);

/* Border Tokens */
--border-radius: 0.5rem;
--border-width: 0.0625rem;
--border-color: oklch(90.37% 0 0);

/* Text Tokens */
--text-primary: oklch(0% 0 0);
--text-secondary: oklch(40.17% 0 0);

/* Primary Brand Colors */
--primary-lighter: oklch(91.58% 0 0);
--primary: oklch(17.76% 0 0);
--primary-dark: oklch(0% 0 0);
--primary-foreground: oklch(100% 0 0);

/* Secondary Colors */
--secondary-lighter: oklch(91.99% 0.0386 276.02);
--secondary: oklch(50.51% 0.2633 276.95);
--secondary-dark: oklch(45.41% 0.2431 277.06);
--secondary-foreground: oklch(100% 0 0);

/* Danger/Error Colors */
--red-lighter: oklch(89.99% 0.0393 14);
--red: oklch(59.6% 0.2445 29.23);
--red-dark: oklch(51.71% 0.2121 29.2338);

/* Warning Colors */
--orange-lighter: oklch(95.67% 0.0452 84.5695);
--orange: oklch(78.37% 0.1587 72.99);
--orange-dark: oklch(54.83% 0.1339 53.95);

/* Info Colors */
--blue-lighter: oklch(91.66% 0.0404 257.5078);
--blue: oklch(57.31% 0.2144 258.25);
--blue-dark: oklch(51.58% 0.1888 258.27);

/* Success Colors */
--green-lighter: oklch(92.79% 0.086 155.61);
--green: oklch(64.01% 0.1776 148.74);
--green-dark: oklch(53.79% 0.1441 149.52);
}

/* Map CSS variables to Tailwind's color system */
@theme inline {
--color-background: var(--background);
--color-foreground: var(--foreground);
--color-muted: var(--muted);
--color-muted-foreground: var(--muted-foreground);

--border-radius: var(--border-radius);
--color-border: var(--border-color);

--color-text-primary: var(--text-primary);
--color-text-secondary: var(--text-secondary);

--color-primary-lighter: var(--primary-lighter);
--color-primary: var(--primary);
--color-primary-dark: var(--primary-dark);
--color-primary-foreground: var(--primary-foreground);

--color-secondary-lighter: var(--secondary-lighter);
--color-secondary: var(--secondary);
--color-secondary-dark: var(--secondary-dark);
--color-secondary-foreground: var(--secondary-foreground);

--color-red-lighter: var(--red-lighter);
--color-red: var(--red);
--color-red-dark: var(--red-dark);

--color-orange-lighter: var(--orange-lighter);
--color-orange: var(--orange);
--color-orange-dark: var(--orange-dark);

--color-blue-lighter: var(--blue-lighter);
--color-blue: var(--blue);
--color-blue-dark: var(--blue-dark);

--color-green-lighter: var(--green-lighter);
--color-green: var(--green);
--color-green-dark: var(--green-dark);
}

/* Override browser autofill background for all input components */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus,
input:-webkit-autofill:active,
textarea:-webkit-autofill,
textarea:-webkit-autofill:hover,
textarea:-webkit-autofill:focus,
textarea:-webkit-autofill:active {
-webkit-box-shadow: 0 0 0 1000px transparent inset !important;
-webkit-text-fill-color: inherit !important;
transition: background-color 5000s ease-in-out 0s;
caret-color: inherit;
}

/* Firefox autofill */
input:-moz-autofill,
input:-moz-autofill:hover,
input:-moz-autofill:focus,
input:-moz-autofill:active,
textarea:-moz-autofill,
textarea:-moz-autofill:hover,
textarea:-moz-autofill:focus,
textarea:-moz-autofill:active {
background-color: transparent !important;
color: inherit !important;
transition: background-color 5000s ease-in-out 0s;
}

About OKLCH Color Space OKLCH is a modern color space that provides perceptually uniform colors. Unlike RGB/HEX, colors with the same lightness value in OKLCH appear equally bright to human eyes, making it ideal for creating accessible and visually consistent color palettes.

Step 4

Configure PostCSS

Create or update your postcss.config.mjs:

const config = {
plugins: {
'@tailwindcss/postcss': {},
},
};
export default config;

Usage

Now you're ready to start using RizzUI components in your application. For dark mode support, refer to our dark mode guide.

Basic Example

Here's a simple example to get you started:

import { Button } from 'rizzui/button';

export default function App() {
return (
<>
<Button>Get Started</Button>
</>
);
}

Class Name Utility (cn)

The cn utility helps you merge Tailwind CSS classes intelligently. It automatically resolves conflicting classes and combines multiple class sources into a single string.

Key Features:

  • Resolves Tailwind class conflicts (e.g., px-2 vs px-4px-4 wins)
  • Supports strings, arrays, objects, and conditional expressions
  • Type-safe with full TypeScript support

Example:

The cn utility function is used to conditionally combine class names based on component props, enabling dynamic styling of the component.

import { cn } from 'rizzui/cn';
import { Button } from 'rizzui/button';

const CustomButton = ({ className, variant = 'primary', ...props }) => (
<Button
{...props}
className={cn(
'bg-gradient-to-r text-white shadow-lg hover:shadow-xl transition-all',
variant === 'primary'
? 'from-purple-600 via-purple-500 to-blue-600'
: 'from-pink-500 via-rose-500 to-orange-500',
className
)}
/>
);

Next Steps

Now that you have RizzUI set up, explore these resources to enhance your application:

Support

If you encounter any issues or have questions:

  • Open an issue on GitHub
  • Check our documentation for detailed guides
  • Join our community for support and discussions