npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

@ui-component-lib/ui

v1.0.0

Published

A modern, accessible UI component library for Next.js with 25 production-ready components built with React, TypeScript, Radix UI, and Tailwind CSS

Downloads

85

Readme

@ui-component-lib/ui

A modern, accessible UI component library built with React, TypeScript, Radix UI primitives, and Tailwind CSS.

Features

  • 🎨 25 Production-Ready Components - Comprehensive collection of UI primitives and compound components
  • Accessibility First - Built on Radix UI with WAI-ARIA compliance and keyboard navigation
  • 🎭 Dark Mode Support - All components support light and dark themes out of the box
  • 📱 Responsive Design - Mobile-first approach with responsive variants
  • 🔧 Fully Customizable - Extend with Tailwind CSS utility classes
  • 📦 Tree-Shakeable - Import only what you need
  • 🎯 TypeScript Support - Comprehensive type definitions included
  • Next.js 15 Compatible - Works seamlessly with App Router and Server Components

Installation

npm install @ui-component-lib/ui
# or
pnpm add @ui-component-lib/ui
# or
yarn add @ui-component-lib/ui

Peer Dependencies

This library requires React 19+ and Tailwind CSS 4+:

npm install react@^19.0.0 tailwindcss@^4.0.0

Setup

1. Import Styles

Add the component library styles to your app:

// app/layout.tsx (Next.js App Router)
import "@ui-component-lib/ui/styles.css";

export default function RootLayout({
	children,
}: {
	children: React.ReactNode;
}) {
	return (
		<html lang="en">
			<body>{children}</body>
		</html>
	);
}

2. Configure Tailwind

Update your tailwind.config.js to scan the component library:

/** @type {import('tailwindcss').Config} */
module.exports = {
	content: [
		"./app/**/*.{js,ts,jsx,tsx}",
		"./components/**/*.{js,ts,jsx,tsx}",
		// Add this line to scan the component library
		"./node_modules/@ui-component-lib/ui/dist/**/*.{js,mjs}",
	],
};

3. Dark Mode (Optional)

For dark mode support, configure Tailwind with class-based dark mode:

// tailwind.config.js
module.exports = {
	darkMode: "class",
	// ... rest of config
};

Then toggle dark mode by adding/removing the dark class on the <html> element:

<html className={isDark ? 'dark' : ''}>

Quick Start

import {
	Button,
	Input,
	Card,
	CardHeader,
	CardTitle,
	CardContent,
} from "@ui-component-lib/ui";

export default function LoginForm() {
	return (
		<Card className="w-96">
			<CardHeader>
				<CardTitle>Login</CardTitle>
			</CardHeader>
			<CardContent className="space-y-4">
				<Input type="email" label="Email" placeholder="[email protected]" />
				<Input type="password" label="Password" placeholder="••••••••" />
				<Button variant="primary" className="w-full">
					Sign In
				</Button>
			</CardContent>
		</Card>
	);
}

Available Components

Primitives

  • Button - Flexible button component with variants
  • Input - Text input with label and error states
  • Textarea - Multi-line text input
  • Badge - Small status indicators
  • Avatar - User profile images with fallback
  • Divider - Visual content separator
  • Spinner - Loading indicator
  • Typography - Text elements with variants

Form Components

  • Checkbox - Checkbox with label
  • Radio - Radio button groups
  • Switch - Toggle switch
  • Select - Dropdown select menu

Layout

  • Card - Content container with header, body, and footer
  • Table - Data table with header and rows
  • Skeleton - Loading placeholder

Navigation

  • Breadcrumb - Hierarchical navigation
  • Tabs - Tab navigation with panels
  • DropdownMenu - Context menu with items

Feedback

  • Alert - Notification messages
  • Toast - Temporary notifications
  • Progress - Progress indicator

Overlays

  • Dialog - Modal dialog
  • Popover - Floating content container
  • Tooltip - Hover information
  • Accordion - Collapsible content sections

Component Examples

Button Variants

import { Button } from '@ui-component-lib/ui'

<Button variant="primary">Primary</Button>
<Button variant="secondary">Secondary</Button>
<Button variant="danger">Danger</Button>
<Button variant="success">Success</Button>
<Button variant="warning">Warning</Button>
<Button variant="outline">Outline</Button>
<Button variant="ghost">Ghost</Button>

Form Components

import { Checkbox, Radio, Switch, Select } from '@ui-component-lib/ui'

// Checkbox
<Checkbox
  id="terms"
  label="I agree to the terms and conditions"
  checked={checked}
  onCheckedChange={setChecked}
/>

// Radio Group
<div className="space-y-2">
  <Radio id="option1" name="options" label="Option 1" value="1" />
  <Radio id="option2" name="options" label="Option 2" value="2" />
</div>

// Switch
<Switch
  id="notifications"
  label="Enable notifications"
  checked={enabled}
  onCheckedChange={setEnabled}
/>

// Select
<Select>
  <SelectTrigger>
    <SelectValue placeholder="Select an option" />
  </SelectTrigger>
  <SelectContent>
    <SelectItem value="1">Option 1</SelectItem>
    <SelectItem value="2">Option 2</SelectItem>
  </SelectContent>
</Select>

Toast Notifications

import { ToastProvider, useToast, Button } from "@ui-component-lib/ui";

function App() {
	return (
		<ToastProvider>
			<MyComponent />
		</ToastProvider>
	);
}

function MyComponent() {
	const { displayToast } = useToast();

	return (
		<Button onClick={() => displayToast("Operation successful!", "success")}>
			Show Toast
		</Button>
	);
}

Dialog (Modal)

import {
	Dialog,
	DialogTrigger,
	DialogContent,
	DialogHeader,
	DialogTitle,
	DialogDescription,
	Button,
} from "@ui-component-lib/ui";

<Dialog>
	<DialogTrigger asChild>
		<Button>Open Dialog</Button>
	</DialogTrigger>
	<DialogContent>
		<DialogHeader>
			<DialogTitle>Confirm Action</DialogTitle>
			<DialogDescription>Are you sure you want to proceed?</DialogDescription>
		</DialogHeader>
		{/* Dialog content */}
	</DialogContent>
</Dialog>;

Customization

All components accept a className prop for custom styling:

<Button className="rounded-full px-8 py-4 text-lg">Custom Styled Button</Button>

Using Tailwind Utilities

<Card className="max-w-md mx-auto shadow-2xl">
	<CardHeader className="bg-gradient-to-r from-blue-500 to-purple-500">
		<CardTitle className="text-white">Gradient Header</CardTitle>
	</CardHeader>
	<CardContent className="space-y-4 p-6">{/* Content */}</CardContent>
</Card>

Accessibility

All components follow WAI-ARIA best practices:

  • Proper ARIA attributes and roles
  • Keyboard navigation support
  • Screen reader friendly
  • Focus management
  • Semantic HTML

TypeScript

Full TypeScript support with exported types:

import type { ButtonProps, InputProps, CardProps } from "@ui-component-lib/ui";

const MyButton: React.FC<ButtonProps> = (props) => {
	return <Button {...props} />;
};

Browser Support

  • Chrome (latest)
  • Firefox (latest)
  • Safari (latest)
  • Edge (latest)

Next.js Integration

Server Components

Most components work with Next.js Server Components:

// app/page.tsx (Server Component)
import { Card, CardHeader, CardTitle } from "@ui-component-lib/ui";

export default function Page() {
	return (
		<Card>
			<CardHeader>
				<CardTitle>Server Component</CardTitle>
			</CardHeader>
		</Card>
	);
}

Client Components

Interactive components require 'use client':

"use client";

import { Button, useToast } from "@ui-component-lib/ui";

export default function ClientComponent() {
	const { displayToast } = useToast();

	return (
		<Button onClick={() => displayToast("Clicked!", "success")}>
			Click Me
		</Button>
	);
}

License

MIT

Contributing

This is a thesis project. For questions or contributions, please open an issue on GitHub.

Documentation

For full documentation and interactive examples, visit our Storybook.