Skip to content

binaryjack/pulsar-ui.dev

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

187 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Pulsar UI

Component library for the Pulsar framework

Version 0.7.0-alpha TypeScript 5.0+ MIT License Pulsar 0.7.0-alpha

AboutInstallationQuick StartComponentsRoadmapContributing

follow me


About

@pulsar/ui is the official component library for the Pulsar framework. It provides production-ready, accessible UI components built with fine-grained reactivity, TailwindCSS styling, and a fluent builder API for configuration.

Key Features

  • 🎨 Design Tokens: Uses @pulsar/design-tokens for consistent styling
  • 📏 Size System: Standardized sizing (xs, sm, md, lg, xl) across all components
  • 🎭 Variant System: Multiple style variants (solid, outline, ghost, soft)
  • 🏗️ Builder Pattern: Fluent API for component configuration
  • 🎯 Type-Safe: Full TypeScript support with strict typing
  • Accessible: ARIA attributes and keyboard navigation built-in
  • 🚀 Pulsar-Native: Built specifically for Pulsar's reactivity system
  • 💅 TailwindCSS: Utility-first styling with custom configuration
  • 📦 Modular: Clean architecture with one item per file

🎨 Live Showcase

Explore 80+ Advanced Examples: GitHub Pages Showcase (Coming Soon)

The showcase demonstrates production-grade patterns from the Pulsar ecosystem:

Featured Patterns

1. Portal/PortalSlot Architecture

// Modal with content projection - logic stays local, UI projects globally
<Modal id="demo" isOpen={isOpen} onClose={closeModal} />
<Portal id="demo" target="body">
  <input value={localData()} onInput={updateLocalData} />
  {/* Component scope preserved, UI rendered in portal */}
</Portal>

Benefits:

  • UI projected to global DOM (modal, tooltip, dropdown)
  • State and logic remain in component scope
  • Clean separation of concerns
  • No prop drilling

2. Error Boundaries (Tryer/Catcher)

// Graceful error handling with isolated boundaries
<Tryer>
  <ComponentThatMightFail />
  <Catcher>
    {(error) => <ErrorDisplay error={error} />}
  </Catcher>
</Tryer>

Features:

  • Independent error boundaries
  • Prevents app-wide crashes
  • Fallback UI for failed sections
  • Error propagation control

3. Signal-Based Reactivity

// Fine-grained updates with automatic dependency tracking
const [count, setCount] = createSignal(0);
const double = createMemo(() => count() * 2);

// Only subscribed DOM nodes update - no virtual DOM diffing
<div>{count()}</div>  {/* Updates when count changes */}
<div>{double()}</div> {/* Updates when count changes */}

4. Resource Caching

// Stale-while-revalidate with automatic cache management
const user = createResource(() => fetchUser(id), {
  staleTime: 5000 // Fresh for 5 seconds
});

// Instant cache hits, background revalidation
<Show when={user.data}>
  {(u) => <Profile user={u} />}
</Show>

5. Dependency Injection

// ServiceManager with lifecycle management
const services = new ServiceManager();

services.register('analytics', () => new Analytics(), {
  lifetime: 'singleton', // Single instance app-wide
});

// Use in components
const analytics = inject('analytics');
analytics.track('event');

6. Control Flow Primitives

// Declarative control flow with proper keying
<Show when={isLoggedIn()}><Dashboard /></Show>
<For each={items()}>{(item) => <Item {...item} />}</For>
<Index each={colors()}>{(color, i) => <Color value={color()} />}</Index>

Showcase Structure

📁 src/showcase/

├── reactivity/         # Signal, memo, effect demos
├── portal/            # Modal, tooltip portals
├── error-boundary/    # Tryer/Catcher patterns
├── resource/          # Data fetching, caching
├── di/                # Dependency injection
├── control-flow/      # Show, For, Index
└── components/        # Component composition

🔗 View Source: packages/pulsar-ui.dev/src/showcase

Run Showcase Locally

pnpm showcase:dev  # Development server
pnpm showcase:build # Build for production

Installation

pnpm add @pulsar/ui

Dependencies

The component library requires:

  • pulsar - The Pulsar framework
  • @pulsar/design-tokens - Design system tokens
  • tailwindcss - Utility-first CSS framework

Quick Start

Builder Pattern Configuration

All components use a fluent builder pattern for configuration:

import { ComponentConfig, Button } from '@pulsar/ui';

// Create a configuration
const config = new ComponentConfig('primary') // Start with color
  .variant('solid') // Set variant
  .size('lg') // Set size
  .rounded('md') // Border radius
  .shadow('lg') // Shadow
  .fullWidth() // Full width
  .build(); // Build final config

// Use configuration with component
const myButton = Button({
  config,
  label: 'Click Me',
  onclick: () => console.log('Clicked!'),
});

Simple Usage

import { PrimaryButton, Input, Badge } from '@pulsar/ui';

// Use factory variants for quick setup
const saveButton = PrimaryButton({
  label: 'Save Changes',
  onclick: () => saveFn(),
});

const emailInput = Input({
  type: 'email',
  placeholder: 'your@email.com',
  required: true,
});

const statusBadge = Badge({
  label: 'Active',
  color: 'success',
});

Components

Atoms

  • Button - Interactive button with variants, sizes, icons, loading states
  • Input - Text input with prefix/suffix, error states, validation
  • Checkbox - Accessible checkbox with indeterminate state
  • Radio - Radio button for single selections
  • Toggle - Switch/toggle component for boolean states
  • Textarea - Multi-line text input
  • Spinner - Loading spinner with size variants
  • Skeleton - Skeleton loader for content placeholders
  • Typography - Heading, paragraph, and text components

Molecules

  • Badge - Status and label badges with colors and variants
  • Button Group - Grouped buttons with shared configuration
  • Label - Form labels with required indicators
  • Radio Group - Radio button groups with shared state

Organisms

  • Card - Container with header, body, footer sections

ComponentConfig Builder API

new ComponentConfig(color) // 'primary' | 'secondary' | 'success' | 'warning' | 'error' | 'neutral'
  .variant(value) // 'solid' | 'outline' | 'ghost' | 'soft'
  .size(value) // 'xs' | 'sm' | 'md' | 'lg' | 'xl'
  .rounded(value) // 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl' | 'full'
  .shadow(value) // 'none' | 'sm' | 'md' | 'lg' | 'xl' | '2xl'
  .border(boolean) // Enable/disable border
  .disabled(boolean) // Disabled state
  .loading(boolean) // Loading state
  .fullWidth(boolean) // Full width
  .transition(boolean) // Enable transitions
  .transitionDuration(value) // 'fast' | 'normal' | 'slow'
  .hover(boolean) // Enable hover effects
  .focus(boolean) // Enable focus effects
  .active(boolean) // Enable active effects
  .className(string) // Additional CSS classes
  .build(); // Returns IComponentConfig

Roadmap

✅ v0.1.0 - Foundation (Current)

  • ✅ Atoms: Button, Input, Checkbox, Radio, Toggle, Textarea, Spinner, Skeleton, Typography
  • ✅ Molecules: Badge, Button Group, Label, Radio Group
  • ✅ Organisms: Card
  • ✅ Builder pattern API
  • ✅ Design token integration
  • ✅ TypeScript strict mode
  • ✅ TailwindCSS integration

🚧 v0.2.0 - Enhanced Components (Q2 2026)

  • 🔄 Select - Dropdown select with search and multi-select
  • 🔄 Modal - Dialog and modal components
  • 🔄 Dropdown - Menu dropdown with keyboard navigation
  • 🔄 Tabs - Tab navigation component
  • 🔄 Accordion - Collapsible content panels
  • 🔄 Toast - Toast notifications system
  • 🔄 Tooltip - Contextual tooltips
  • 🔄 Popover - Popover content containers

🎯 v0.3.0 - Advanced Components (Q3 2026)

  • 📋 Table - Data table with sorting, filtering, pagination
  • 📊 Chart - Basic chart components (bar, line, pie)
  • 📅 Date Picker - Calendar date selection
  • 🎨 Color Picker - Color selection component
  • 📁 File Upload - Drag-and-drop file upload
  • 🔍 Search - Search input with suggestions
  • 🏷️ Tag Input - Multi-tag input component
  • 📝 Rich Text Editor - WYSIWYG editor

🌟 v1.0.0 - Production Ready (Q4 2026)

  • 🎨 Theming System - Custom theme creation and switching
  • 📱 Responsive Utilities - Mobile-first responsive components
  • 🌙 Dark Mode - Complete dark mode support
  • A11y Audit - Full accessibility compliance
  • 📖 Storybook - Interactive component documentation
  • 🧪 Test Coverage 90%+ - Comprehensive test suite
  • 📦 Tree Shaking - Optimized bundle sizes
  • 🎭 Animation Library - Pre-built animation presets

Ecosystem

Part of the Pulsar framework ecosystem:

Package Description Repository
pulsar.dev Main reactive framework GitHub
@pulsar/ui Component library (this package) GitHub
@pulsar/design-tokens Design tokens & brand assets GitHub
@pulsar/transformer JSX transformer GitHub
@pulsar/vite-plugin Vite integration GitHub
pulsar-demo Example applications GitHub

Contributing

Contributions welcome! We need help with:

  • 🎨 New Components - Build additional UI components
  • Accessibility - Improve ARIA support and keyboard navigation
  • 📖 Documentation - Add examples and usage guides
  • 🧪 Tests - Increase test coverage
  • 🐛 Bug Fixes - Report and fix issues
  • 💡 Feature Requests - Suggest new components or improvements

Development Setup

# Clone the repository
git clone https://github.com/binaryjack/pulsar-ui.dev.git
cd pulsar-ui.dev

# Install dependencies
pnpm install

# Build
pnpm build

# Watch mode
pnpm dev

Code Guidelines

  • ✅ One item per file (interfaces, types, implementations)
  • ✅ TypeScript strict mode (no any types)
  • ✅ Prototype-based classes for components
  • ✅ Use Pulsar.HtmlExtends<T> for HTML props
  • ✅ Builder pattern for component configuration
  • ✅ Comprehensive JSDoc comments

License

MIT License - Copyright (c) 2026 Pulsar Framework

See LICENSE for full details.


Acknowledgments

Built with ⚡ by Tadeo Piana and contributors.

Design inspiration from:


@pulsar/ui - v0.1.0
Component library for the Pulsar framework

GitHubPulsar FrameworkConnect with the Creator

About

pulsar-ui component library

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors