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

windelements

v0.0.1

Published

Production-ready UI components for Vanilla JS/TS - like shadcn/ui but for vanilla JavaScript

Downloads

9

Readme

📚 Documentation | API Reference | Quick Start

✨ Features

  • 🎨 70+ Production-Ready Components - Complete UI library with buttons, forms, navigation, overlays, data display, marketing components and more
  • 🎯 Fully Customizable - Every component accepts className prop for Tailwind CSS or custom CSS styling
  • 📦 Zero Runtime Dependencies - Pure vanilla JavaScript/TypeScript
  • 🔧 CLI Tool - Install components individually or all at once
  • 💎 TypeScript First - Full type safety with .d.ts files
  • 🎨 OKLCH Color System - Modern color definitions with automatic dark mode
  • Tree-Shakeable - Only bundle what you use
  • 🎭 Works Everywhere - No framework required
  • 📚 Comprehensive Docs - Full documentation with live examples at muhammad-fiaz.github.io/WindElements

Installation

WindElements works like shadcn/ui - components are copied to YOUR project, not installed as npm dependencies.

Initialize Your Project

npx windelements@latest init

This will:

  • ✅ Create components.json configuration
  • ✅ Require TypeScript and Tailwind CSS configuration
  • ✅ Set up component directory (default: src/components/ui)
  • ✅ Auto-inject OKLCH theme CSS variables
  • ✅ Copy utility functions to your project

Add Components

# Add individual components (copied to src/components/ui/)
npx windelements@latest add button
npx windelements@latest add input
npx windelements@latest add dialog

# Add multiple components
npx windelements@latest add button input card

# Add all components
npx windelements@latest add --all

# Overwrite existing
npx windelements@latest add button --overwrite

Components are copied to src/components/ui/ - you own the code!

Usage

Components are in YOUR project at src/components/ui/. Import and use them:

// Import from YOUR source code (not from npm!)
import { createButton } from './components/ui/button';
import { createInput } from './components/ui/input';
import { createCard, createCardHeader, createCardTitle } from './components/ui/card';

// Create a button
const button = createButton({
  variant: 'default',
  children: 'Click me',
  onClick: (e) => console.log('Clicked!')
});

// Create an input
const input = createInput({
  type: 'text',
  placeholder: 'Enter your name...',
  onInput: (e) => console.log((e.target as HTMLInputElement).value)
});

// Create a card
const card = createCard();
const cardHeader = createCardHeader();
const cardTitle = createCardTitle({ children: 'My Card' });
const cardContent = createCardContent();

cardContent.getElement().appendChild(input.getElement());
cardContent.getElement().appendChild(button.getElement());
cardHeader.getElement().appendChild(cardTitle.getElement());
card.getElement().appendChild(cardHeader.getElement());
card.getElement().appendChild(cardContent.getElement());

document.body.appendChild(card.getElement());

JavaScript Example

import { createButton } from './components/ui/button.js';

const button = createButton({
  variant: 'default',
  children: 'Click me',
  onClick: () => alert('Hello!')
});

document.body.appendChild(button.getElement());

📦 Available Components (70+)

🎨 Foundational Components (11)

button button-group input label textarea form file-upload checkbox switch radio-group kbd

📐 Layout Components (10)

card separator accordion aspect-ratio breadcrumb collapsible tabs scroll-area divider resizable

🧭 Navigation Components (6)

navbar sidebar footer menubar dropdown-menu context-menu

💬 Feedback Components (11)

alert alert-dialog badge progress skeleton spinner toast tooltip empty notification sonner

📝 Form Components (11)

select slider toggle toggle-group input-otp combobox counter calendar date-picker rating file-upload

🎭 Display Components (13)

avatar avatar-group table data-table typography pagination chip stats timeline stepper carousel testimonial empty

🪟 Overlay Components (10)

dialog drawer popover modal sheet hover-card hint command alert-dialog tooltip

🎯 Marketing Components (4)

hero feature-card pricing-card testimonial

View Full Component Documentation →

Component API

All components follow a consistent API pattern:

Class-based API

const component = new ComponentName(props);
const element = component.getElement();
component.update(newProps);
component.destroy();

Factory Function API

const component = createComponentName(props);
const element = component.getElement();

Configuration

Your components.json file:

{
  "typescript": true,
  "componentDir": "src/components/ui",
  "utilsDir": "src/lib",
  "cssFile": "src/styles/globals.css",
  "tailwindConfig": "tailwind.config.js"
}

Styling

All components use CSS custom properties for theming:

:root {
  --radius: 0.625rem;
  --background: oklch(1 0 0);
  --foreground: oklch(0.145 0 0);
  --primary: oklch(0.205 0 0);
  --primary-foreground: oklch(0.985 0 0);
  /* ... more theme variables */
}

.dark {
  --background: oklch(0.145 0 0);
  --foreground: oklch(0.985 0 0);
  /* ... dark mode overrides */
}

TypeScript

All components are fully typed:

import { Button, ButtonProps } from './components/button';

const props: ButtonProps = {
  variant: 'default',
  size: 'lg',
  disabled: false,
  onClick: (e: MouseEvent) => console.log(e)
};

const button = new Button(props);

License

This project is licensed under the MIT License - see the LICENSE file for details.

Star History

Star History Chart

Credits

Inspired by shadcn/ui