Skip to content

Components

Browse all 70+ production-ready components for your Vanilla JavaScript/TypeScript project.

All Components

🎨 Foundational (11 components)

Components for building forms and basic interactions.

📐 Layout (10 components)

Components for structuring your UI.

🧭 Navigation (6 components)

Components for site navigation.

💬 Feedback (11 components)

Components for user feedback and notifications.

📝 Form Components (10 components)

Advanced form inputs and controls.

🎭 Display (13 components)

Components for displaying data and content.

🪟 Overlay (10 components)

Components that overlay the main content.

🎯 Marketing (4 components)

Components for marketing and landing pages.

Installation

Add components individually:

bash
npx windelements@latest add button
npx windelements@latest add card

Or add all components:

bash
npx windelements@latest add --all

Usage Pattern

All components follow a consistent API:

typescript
import { createComponentName } from './components/ui/component-name';

const component = createComponentName({
  // Props here
  className: 'custom-class',
  onClick: () => console.log('Clicked!')
});

// Get the DOM element
const element = component.getElement();

// Append to DOM
document.body.appendChild(element);

Customization

Every component accepts a className prop for custom styling:

typescript
const button = createButton({
  variant: 'default',
  className: 'my-custom-class hover:scale-105',
  children: 'Custom Button'
});

TypeScript

All components are fully typed:

typescript
import { ButtonProps } from './components/ui/button';

const props: ButtonProps = {
  variant: 'primary',
  size: 'lg',
  disabled: false
};

Released under the MIT License.