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 🙏

© 2025 – Pkg Stats / Ryan Hefner

cubes-ui

v0.0.114

Published

Modern, reusable, and **developer-friendly UI components** powered by **Tailwind CSS** — perfect for building scalable design systems and accelerating development.

Readme

Cubes UI

Modern, reusable, and developer-friendly UI components powered by Tailwind CSS — perfect for building scalable design systems and accelerating development.

read documentation

npm downloads npm version bundle size license


🚀 Installation

npm install cubes-ui

⚙️ Setup

npx cubes-ui-init

This command will:

  • Install required Tailwind packages
  • Configure Vite with Tailwind plugin
  • Update your CSS with:
@import "tailwindcss";
@import "cubes-ui/index.css";
@source "../node_modules/cubes-ui/dist/index.css";

🧪 Usage

import { Button } from "cubes-ui";

export default function Example() {
  return <Button variant="default" size="lg">Click me</Button>;
}

🔔 Toast System (powered by Sonner)

Cubes UI uses Sonner for elegant toast notifications:

import { toast } from "cubes-ui";

toast.success("Saved!");
toast.error("Oops...");
toast.custom(<div>Custom JSX</div>);
  • Multiple positions (top-left, bottom-center, etc.)
  • Pause on hover
  • Light/Dark theme support
  • Dynamic content
  • Full control via options:
toast.success("Updated!", { position: "top-center" });

🔌 Integrations

TanStack Query

import { Spinner, useQuery } from "cubes-ui";
const { data, isLoading } = useQuery({ endpoint: "users" });

React Hook Form

import { Input, Button, useForm } from "cubes-ui";

Zod Validation

import { Validator, Input, FormError, useForm } from "cubes-ui";

🧱 Built-in Hooks

Cubes UI provides fully-typed and scalable hooks:

🔩 Core Utilities

| Hook | Description | |--------------------|------------------------------------------------------------| | useDebounce | Debounces value or function | | useThrottle | Throttles updates | | useClickOutside | Detects outside clicks | | useMediaQuery | Tracks screen breakpoints | | useLocalStorage | LocalStorage abstraction | | useSessionStorage| SessionStorage abstraction | | useIndexedDB | Async IndexedDB state | | useCacheStorage | Caches API responses locally |

🌐 API & Request Hooks

| Hook | Description | |---------------|--------------------------------------------------------------------------| | useRequest | Unified fetch via TanStack Query | | useMutation | Typed mutations with endpoint/token | | useQuery | Enhanced query with loader and endpoint |

⚡️ Realtime & WebSocket Hooks

| Hook | Description | |--------------|--------------------------------------------------------------------------| | useSocket | WebSocket integration with token and reconnect support |

🎭 UI/UX Hooks

| Hook | Description | |--------------------|---------------------------------------------------------| | useLazyTransition| Improved transitions via useTransition wrapper | | useIsFirstRender | Detect initial render | | useHoverIntent | Intent-based hover detection | | useMountEffect | Run effect only once on mount |

🧪 Developer Experience

| Hook | Description | |-------------------|--------------------------------------------------------------| | useTraceRender | Logs re-renders for performance insights |


⚙️ Context with CubesProvider

<CubesProvider
  apiUrl="https://api.example.com"
  getToken={() => localStorage.getItem("token")}
  onUnauthorized={() => redirectTo("/login")}
>
  <App />
</CubesProvider>

Hooks like useRequest and useSocket automatically access this context.


🧠 Tips & Tricks

  • Tailwind-safe imports using @source
  • Custom themes via @layer
  • Dark mode support out-of-the-box

🔗 Resources


❤️ Built for developers who love clean UI

Cubes UI helps you move faster with consistent design, powerful hooks, and blazing-fast integration.
Built with love and Tailwind.