A modern React component library built with Next.js 15, React 19, TypeScript, Tailwind CSS 4, and Storybook.
- React 19 - Latest version of React
- Next.js 15 - React framework
- TypeScript - Static type checking
- Tailwind CSS 4 - Utility-first CSS framework
- Storybook - Component development and documentation tool
- Vitest - Testing framework
- Lucide React - Icon library
- clsx + tailwind-merge - Class name utilities
- Node.js (version 20 or higher)
- npm, yarn, or pnpm
- Clone the repository:
git clone <repository-url>
cd react-component-library
- Install dependencies:
npm install
# or
yarn install
# or
pnpm install
# Run Next.js in development mode
npm run dev
# Run Storybook (recommended for component development)
npm run storybook
Storybook will be available at http://localhost:6006
# Build Next.js application
npm run build
# Run production server
npm run start
# Build Storybook
npm run build-storybook
# Run linter
npm run lint
Universal input field component with support for various types, validation, and additional features.

Features:
- π Type support: text, password, number, email, tel
- ποΈ Password visibility toggle
- β Clearable button
- π·οΈ Label and error messages
- βΏ Full accessibility support
- π¨ Multiple states: default, focus, error, disabled
- π Controlled and uncontrolled modes
Usage:
import Input from "@/components/Input";
// Basic usage
<Input placeholder="Enter text..." />
// With label and error
<Input
label="Email"
type="email"
error="Invalid email format"
value={email}
onChange={(e) => setEmail(e.target.value)}
/>
// Password with visibility toggle
<Input
type="password"
placeholder="Password"
clearable
/>
Props:
type
- input type (text, password, number, email, tel)clearable
- show clear buttonplaceholder
- placeholder textvalue
- value (for controlled mode)onChange
- change handlerdisabled
- disabled statelabel
- label for the inputerror
- error textclassName
- additional CSS classes
Notification component with support for different types, animations, and auto-dismiss.

Features:
- β Types: success, error, warning, info
- π¨ Icons and color indication for each type
- β±οΈ Auto-dismiss with configurable duration
- β Option to disable close button
- π Smooth enter/exit animations
- π Support for title and description
- βΏ ARIA attributes for accessibility
Usage:
import Toast from "@/components/Toast";
import ToastContainer from "@/components/ToastContainer";
// In component
<Toast
type="success"
message="Successfully saved!"
description="Your changes have been saved"
duration={3000}
closable={true}
onClose={() => console.log("Toast closed")}
/>
// With ToastContainer to manage multiple toasts
<ToastContainer>
{/* Your toast notifications */}
</ToastContainer>
Props:
type
- notification type (success, error, warning, info)message
- main message (required)description
- additional descriptionduration
- display time in milliseconds (0 = no auto-dismiss)closable
- show close buttononClose
- callback on closeclassName
- additional CSS classes
Responsive sidebar menu with support for nested items, animations, and keyboard navigation.

Features:
- π¨ Backdrop overlay with animation
- π³ Nested menus with unlimited depth
- π½ Animated expand/collapse for submenus
- β¨οΈ Keyboard navigation (Escape to close)
- π Body scroll lock when open
- πΌοΈ Icon support for menu items
- π Smooth open/close animations
- βΏ ARIA attributes and semantic HTML
Usage:
import SidebarMenu from "@/components/SidebarMenu";
import { Home, Settings, User } from "lucide-react";
const menuItems = [
{
id: "home",
label: "Home",
icon: <Home size={20} />,
href: "/",
},
{
id: "settings",
label: "Settings",
icon: <Settings size={20} />,
children: [
{
id: "profile",
label: "Profile",
icon: <User size={16} />,
onClick: () => console.log("Profile clicked"),
},
],
},
];
// In component
<SidebarMenu
isOpen={isSidebarOpen}
onClose={() => setIsSidebarOpen(false)}
items={menuItems}
title="Menu"
/>;
Props:
isOpen
- whether the menu is open (required)onClose
- callback to close the menu (required)items
- array of menu items (required)title
- menu titleclassName
- additional CSS classes
MenuItem Interface:
interface MenuItem {
id: string; // Unique identifier
label: string; // Menu item text
icon?: React.ReactNode; // Icon (optional)
href?: string; // Link (optional)
onClick?: () => void; // Click handler (optional)
children?: MenuItem[]; // Nested items (optional)
}
Container for managing and displaying multiple toast notifications.
Usage:
import ToastContainer from "@/components/ToastContainer";
<ToastContainer>
{/* Automatic toast notification positioning */}
</ToastContainer>;
All components use Tailwind CSS and can be customized through:
className
prop for adding custom classes- Modifying Tailwind configuration
- CSS variables for global settings
Utility for combining classes with support for conditional classes and Tailwind class deduplication.
import cn from "@/utils/cn";
<div
className={cn(
"base-class",
condition && "conditional-class",
"text-blue-500",
)}
/>;
Each component has stories with usage examples and interactive controls.
Run Storybook:
npm run storybook
Stories include:
- All component variants
- Interactive controls for props
- Usage documentation
- A11y checks
The project uses Vitest for component testing.
# Run tests
npm run test
# Tests with coverage
npm run test:coverage
- TypeScript - Strict typing for all components
- ESLint - For code quality assurance
- Prettier - For code formatting
- Accessibility - All components have ARIA attributes
To add new components:
- Create a component in
src/components/[ComponentName]/index.tsx
- Add TypeScript interfaces for props
- Create stories in
src/stories/[ComponentName]/
- Add tests (if necessary)
- Update README.md
Volodymyr Bondar