Skip to content

Latest commit

ย 

History

History
654 lines (494 loc) ยท 20.2 KB

File metadata and controls

654 lines (494 loc) ยท 20.2 KB

๐Ÿš€ Installation Guide - Angular SuperUI v2.0.3

โœจ 43 Production-Ready Components + 15 UI Blocks โ€ข TailwindCSS v4 โ€ข TypeScript โ€ข Zero Dependencies โœจ**

๐ŸŽฏ Live Demo โšก Get Started


๐Ÿš€ Step-by-step examples for all 43 components + 15 blocks with interactive showcases, code snippets, and best practices!


โœจ Why Choose Angular SuperUI?

  • ๐ŸŽฏ Zero NPM Dependencies - No angular-superui package required, components are installed locally
  • ๐Ÿ› ๏ธ Selective Installation - Install only what you need with our CLI tool
  • ๐ŸŽจ TailwindCSS v4 - Latest Tailwind features with @import syntax
  • ๐Ÿ“ฆ Local-First - Full control over component code and customization
  • โšก TypeScript Native - Built with TypeScript from the ground up
  • โ™ฟ Accessibility First - WCAG AA compliant components
  • ๐Ÿ”ง Angular 18+ - Modern Angular features and standalone components

โœจ What does the SuperUI CLI do?

  • โœ… Installs Dependencies: tailwindcss@^4.1.11, class-variance-authority, clsx, tailwind-merge@^3.3.1
  • โœ… Configures TailwindCSS v4: Modern @import syntax and PostCSS setup
  • โœ… Updates Styles: Adds CSS variables and theme configuration
  • โœ… TypeScript Paths: Sets up @components/* and @utils/* aliases
  • โœ… Ready to Use: Instantly ready for component installation

๐Ÿš€ Quick Start (Recommended)

Step 1: Install CLI Tool

# Install globally for easy access
npm install -g ngsui-cli

# Or use with npx (no installation)
npx ngsui-cli --help

Step 2: Initialize Your Project

# Navigate to your Angular project root
cd your-angular-project

npx ngsui-cli init

### Step 3: Add Components

# Add individual components
npx ngsui-cli add button
npx ngsui-cli add button card badge alert

# Add all components at once
npx ngsui-cli add --all

# List available components
npx ngsui-cli list

๐Ÿงฉ Available Components (43 Total)

๐ŸŽฏ Core Components

  • ๐Ÿ”˜ Button - Interactive buttons with 9 variants and loading states
  • ๐Ÿท๏ธ Badge - Status indicators and labels with 4 variants
  • ๐Ÿšจ Alert - Contextual feedback messages with 5 variants
  • ๐Ÿ‘ค Avatar - User profile images with automatic fallback support
  • ๐Ÿช— Accordion - Collapsible content sections with single or multiple modes
  • ๐Ÿƒ Card - Flexible content containers with header, content, and footer
  • โ˜‘๏ธ Checkbox - Boolean input control with multiple states and form integration
  • ๐Ÿ”ฝ ComboBox - Advanced dropdown with search, multi-select, and loading states
  • ๐ŸŽญ Chip - Interactive chip component with dismissible and clickable variants
  • ๐Ÿ“ Input - Flexible input component with validation states and accessibility
  • ๐Ÿ”ข InputOTP - One-time password input with multiple slots and validation
  • ๐Ÿ”˜ RadioGroup - Radio button group with accessible selection and validation
  • ๐Ÿ“Š Progress - Progress indicator with customizable appearance and animation
  • โญ Rating - Interactive star rating component with hover effects and customizable appearance
  • ๐Ÿ”ฝ Select - A flexible select dropdown component with search and multi-select capabilities
  • ๐ŸŽš๏ธ Slider - Interactive slider component for single values and ranges with accessibility support
  • ๏ฟฝ Toggle - Toggle switch component with multiple states and accessibility
  • ๏ฟฝ๐Ÿ“„ Textarea - Multi-line text input component with auto-resize and validation states

๐Ÿงญ Navigation & Layout

  • ๐Ÿž Breadcrumb - Navigation breadcrumbs with accessibility and custom separators
  • ๐Ÿ“ AspectRatio - Maintains consistent proportions for responsive content
  • ๐ŸŽฏ Icon - Versatile icon component supporting multiple icon libraries and sizes
  • ๐Ÿ” Menubar - Application menubar with nested submenus and keyboard navigation
  • ๐Ÿ“„ Pagination - Pagination controls with customizable page size and navigation
  • ๐Ÿ  Sidebar - Responsive navigation sidebar with animations, keyboard navigation, and flexible content
  • ๐Ÿ“‹ Stepper - Multi-step navigation component with progress tracking and validation support
  • ๐Ÿ“‘ Tabs - Tabbed interface component with keyboard navigation and accessibility support
  • ๐Ÿ› ๏ธ Toolbar - Group actions and inputs in a compact, responsive bar

๐Ÿ’ซ Overlay & Dialog Components

  • ๐Ÿšจ AlertDialog - Modal dialogs with accessibility and focus management
  • ๐Ÿ–ฑ๏ธ ContextMenu - Right-click context menus with keyboard shortcuts
  • ๐ŸชŸ Dialog - Modal dialog windows with accessibility features
  • ๐Ÿ“„ Drawer - Flexible drawer component that slides in from any side
  • โฌ‡๏ธ DropdownMenu - Beautiful dropdown menus with multiple variants
  • ๐Ÿ’ฌ Popover - Floating overlay that displays content relative to a trigger
  • ๐Ÿ“ข Toast - Toast notification component with multiple variants and auto-dismiss functionality
  • ๐Ÿ’ก Tooltip - Tooltip component with configurable positioning and hover/focus triggers

๐ŸŽจ Media & Display

  • ๐ŸŽ  Carousel - Content slider with auto-play, navigation, and pagination
  • ๐Ÿ—ƒ๏ธ Collapsible - Expandable content sections with smooth animations
  • ๐Ÿ’€ Skeleton - Loading placeholder components with customizable shapes and animations
  • โณ Spinner - Loading spinner component with multiple variants and animations

๐Ÿ“Š Data & Tables

  • ๐Ÿ“Š DataTable - Enterprise-grade data table with sorting, filtering, and pagination

๐Ÿ“ File Management

  • ๐Ÿ“ FileUpload - Advanced file upload component with drag-and-drop, progress tracking, and validation

๐Ÿ“… Featured Components

  • ๐Ÿ“… Calendar - Advanced calendar with date range selection and time picker

โš™๏ธ Utility Components

  • ๐ŸŒ“ ThemeSwitcher - Toggle between light, dark, and system themes

๐Ÿงฑ UI Blocks (10 Total)

Pre-built, customizable UI sections perfect for rapid prototyping and production apps.

๐Ÿ  Landing Page Blocks

  • ๐Ÿฆธ Hero Section - Stunning hero sections with CTAs, images, and animations
  • ๐Ÿ“Š Stats Counter - Animated statistics display with countup effects
  • ๐Ÿ’Ž Feature Grid - Feature showcase with icons, descriptions, and layouts
  • ๐Ÿƒ Feature Card - Individual feature cards with icons and descriptions
  • ๐Ÿ’ฌ Testimonial - Customer testimonials with avatars and ratings

๐Ÿข Business Blocks

  • ๐Ÿ’ฐ Pricing Cards - Pricing tables with features, CTAs, and highlighting
  • ๐Ÿ‘ฅ Team Grid - Team member showcase with social links and roles

๐Ÿ” Authentication Blocks

  • ๐Ÿ”‘ Auth Forms - Login, register, and password reset forms

๐Ÿ—๏ธ Layout Blocks

  • ๐ŸŽฏ Header - Navigation headers with menus, logos, and mobile support
  • ๐Ÿฆถ Footer - Footer sections with links, social icons, and company info

๐Ÿ“‹ Prerequisites

Tool Version Status Notes
Node.js 18+ โœ… Required LTS version recommended
Angular CLI 17+ โœ… Required npm install -g @angular/cli
Angular 17+ โœ… Required Standalone components support
TypeScript 5.0+ โœ… Required Included with Angular

๐Ÿ› ๏ธ Alternative Installation Methods

Method 2: NPM Package (Full Library)

# Install complete library with all components
npm install angular-superui@2.0.3

# Install peer dependencies
npm install class-variance-authority clsx tailwind-merge

Method 3: Manual Setup

For maximum control over your setup:

1. Install Dependencies

npm install class-variance-authority clsx tailwind-merge tailwindcss@^4.1.11

2. Configure TailwindCSS v4

Create or update your styles.css:

@import "tailwindcss";

@layer base {
  :root {
    /* Light Theme Variables */
    --background: hsl(0 0% 100%);
    --foreground: hsl(222.2 84% 4.9%);
    --card: hsl(0 0% 100%);
    --card-foreground: hsl(222.2 84% 4.9%);
    --popover: hsl(0 0% 100%);
    --popover-foreground: hsl(222.2 84% 4.9%);
    --primary: hsl(222.2 47.4% 11.2%);
    --primary-foreground: hsl(210 40% 98%);
    --secondary: hsl(210 40% 96.1%);
    --secondary-foreground: hsl(222.2 47.4% 11.2%);
    --muted: hsl(210 40% 96.1%);
    --muted-foreground: hsl(215.4 16.3% 46.9%);
    --accent: hsl(210 40% 96.1%);
    --accent-foreground: hsl(222.2 47.4% 11.2%);
    --destructive: hsl(0 84.2% 60.2%);
    --destructive-foreground: hsl(210 40% 98%);
    --border: hsl(214.3 31.8% 91.4%);
    --input: hsl(214.3 31.8% 91.4%);
    --ring: hsl(222.2 84% 4.9%);
    --radius: 0.5rem;
  }

  .dark {
    /* Dark Theme Variables */
    --background: hsl(222.2 84% 4.9%);
    --foreground: hsl(210 40% 98%);
    --card: hsl(222.2 84% 4.9%);
    --card-foreground: hsl(210 40% 98%);
    --popover: hsl(222.2 84% 4.9%);
    --popover-foreground: hsl(210 40% 98%);
    --primary: hsl(210 40% 98%);
    --primary-foreground: hsl(222.2 47.4% 11.2%);
    --secondary: hsl(217.2 32.6% 17.5%);
    --secondary-foreground: hsl(210 40% 98%);
    --muted: hsl(217.2 32.6% 17.5%);
    --muted-foreground: hsl(215 20.2% 65.1%);
    --accent: hsl(217.2 32.6% 17.5%);
    --accent-foreground: hsl(210 40% 98%);
    --destructive: hsl(0 62.8% 30.6%);
    --destructive-foreground: hsl(210 40% 98%);
    --border: hsl(217.2 32.6% 17.5%);
    --input: hsl(217.2 32.6% 17.5%);
    --ring: hsl(212.7 26.8% 83.9%);
  }

  body {
    background-color: hsl(var(--background));
    color: hsl(var(--foreground));
  }
}

3. Create PostCSS Config

Create .postcssrc.json:

{
  "plugins": {
    "@tailwindcss/postcss": {}
  }
}

4. Update TypeScript Paths

Add to your tsconfig.json:

{
  "compilerOptions": {
    "baseUrl": "./src",
    "paths": {
      "@components/*": ["lib/components/*"],
      "@utils/*": ["lib/utils/*"]
    }
  }
}

๐ŸŽฏ Usage Examples

Basic Component Usage

import { Component } from '@angular/core';
import { Button } from '@components/button';
import { Card, CardHeader, CardTitle, CardContent } from '@components/card';
import { Badge } from '@components/badge';

@Component({
  selector: 'app-example',
  standalone: true,
  imports: [Button, Card, CardHeader, CardTitle, CardContent, Badge],
  template: `
    <Card class="w-96">
      <CardHeader>
        <CardTitle>Welcome to Angular SuperUI</CardTitle>
      </CardHeader>
      <CardContent>
        <div class="space-y-4">
          <Badge variant="default">v2.0.3</Badge>
          <Button variant="default" (click)="handleClick()">
            Get Started
          </Button>
        </div>
      </CardContent>
    </Card>
  `
})
export class ExampleComponent {
  handleClick() {
    console.log('Button clicked!');
  }
}

Advanced Dashboard Example

import { Component } from '@angular/core';
import { Button } from '@components/button';
import { Card, CardHeader, CardTitle, CardContent } from '@components/card';
import { Badge } from '@components/badge';
import { Avatar } from '@components/avatar';
import { Alert } from '@components/alert';
import { ThemeSwitcher } from '@components/theme-switcher';

@Component({
  selector: 'app-dashboard',
  standalone: true,
  imports: [
    Button, Card, CardHeader, CardTitle, CardContent, 
    Badge, Avatar, Alert, ThemeSwitcher
  ],
  template: `
    <div class="p-6 space-y-6">
      <!-- Header -->
      <div class="flex items-center justify-between">
        <h1 class="text-2xl font-bold">Dashboard</h1>
        <div class="flex items-center gap-4">
          <ThemeSwitcher />
          <Avatar 
            size="default" 
            [src]="'https://github.com/shadcn.png'"
            [alt]="'User Avatar'" />
        </div>
      </div>

      <!-- Alert -->
      <Alert variant="default">
        <h4 class="font-medium">Welcome back!</h4>
        <p class="text-sm">You have 3 new notifications.</p>
      </Alert>

      <!-- Stats Cards -->
      <div class="grid grid-cols-1 md:grid-cols-3 gap-4">
        <Card>
          <CardHeader>
            <CardTitle>Total Sales</CardTitle>
          </CardHeader>
          <CardContent>
            <div class="text-2xl font-bold">$12,345</div>
            <Badge variant="default" class="mt-2">+12%</Badge>
          </CardContent>
        </Card>
        
        <Card>
          <CardHeader>
            <CardTitle>Orders</CardTitle>
          </CardHeader>
          <CardContent>
            <div class="text-2xl font-bold">1,234</div>
            <Badge variant="secondary" class="mt-2">+8%</Badge>
          </CardContent>
        </Card>
        
        <Card>
          <CardHeader>
            <CardTitle>Users</CardTitle>
          </CardHeader>
          <CardContent>
            <div class="text-2xl font-bold">5,678</div>
            <Badge variant="destructive" class="mt-2">-3%</Badge>
          </CardContent>
        </Card>
      </div>

      <!-- Actions -->
      <div class="flex gap-2">
        <Button variant="default">Create New</Button>
        <Button variant="secondary">Export Data</Button>
        <Button variant="outline">Settings</Button>
      </div>
    </div>
  `
})
export class DashboardComponent {}

๐Ÿ”ง CLI Commands Reference

Basic Commands

# Initialize project
ngsui-cli init

# Add single component
ngsui-cli add button

# Add multiple components
ngsui-cli add button card badge alert

# Add all components
ngsui-cli add --all

# List available components
ngsui-cli list

# Get help
ngsui-cli --help

Advanced Options

# Force overwrite existing components
ngsui-cli add button --force

# Use with npx (no global installation)
npx ngsui-cli init
npx ngsui-cli add button

๐ŸŒ Framework Compatibility

Framework Version Status Notes
Angular 18+ โœ… Fully Supported Standalone components
Angular 17 โœ… Supported Standalone components
Angular 16 โš ๏ธ Limited May require adjustments
Angular 15 โŒ Not Supported Standalone components required

โ“ Troubleshooting

Common Issues

TailwindCSS Not Working

# Ensure TailwindCSS v4 is installed
npm install tailwindcss@^4.1.11 @tailwindcss/postcss

# Check .postcssrc.json exists
cat .postcssrc.json

# Restart development server
ng serve

Components Not Found

# Ensure path aliases are configured in tsconfig.json
# Check components were installed in src/lib/components/
ls src/lib/components/

# Re-run init if needed
ngsui-cli init

TypeScript Errors

# Ensure all dependencies are installed
npm install class-variance-authority clsx tailwind-merge

# Check TypeScript version
npx tsc --version  # Should be 5.0+

CSS Variables Not Applied

  • โœ… Ensure styles.css has the @import "tailwindcss" at the top
  • โœ… Check that CSS variables are defined in :root and .dark
  • โœ… Restart your development server after changes

๐Ÿš€ Next Steps

  1. ๐Ÿ“– Explore Components: Visit our Component Documentation
  2. ๐ŸŽฎ Try Live Demo: See all components in action at angular-superui.vercel.app
  3. ๐Ÿ’ก Get Inspired: Check out our Examples Gallery
  4. ๐Ÿค Contribute: Join our GitHub Community

๐Ÿ“ง Support & Community


๐ŸŒŸ Star us on GitHub if Angular SuperUI helped you! ๐ŸŒŸ

GitHub Stars


Built with โค๏ธ by the Angular SuperUI Team

Usage

Import Components

import { Component } from '@angular/core';
import { Alert, Button, Input } from 'angular-superui';

@Component({
  standalone: true,
  imports: [Alert, Button, Input],
  template: `
    <div class="p-6 space-y-4">
      <button variant="primary">Primary Button</button>
      
      <alert variant="success">
        <h5>Success!</h5>
        <div>Your setup is complete!</div>
      </alert>
      
      <input type="text" placeholder="Try typing here..."></input>
    </div>
  `
})
export class AppComponent {}

Module-based Projects

If you're using NgModules instead of standalone components:

import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { Alert, Button, Input } from 'angular-superui';

import { AppComponent } from './app.component';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    Alert,
    Button,
    Input
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }

Framework Compatibility

Framework Version Supported
Angular 18+ โœ…
Angular 17 โœ…
Angular 16 โš ๏ธ Limited
Angular 15 and below โŒ

TypeScript Configuration

Ensure your tsconfig.json includes:

{
  "compilerOptions": {
    "strict": true,
    "esModuleInterop": true,
    "allowSyntheticDefaultImports": true,
    "moduleResolution": "node"
  }
}

Troubleshooting

Common Issues

1. Styles not applying:

  • Ensure Tailwind CSS is properly configured
  • Check that Angular SuperUI is included in your Tailwind content paths
  • Verify CSS variables are defined in your styles.css

2. Components not found:

  • Make sure you've imported the components in your module/component
  • Check that the package is properly installed with npm list angular-superui

3. Build errors:

  • Ensure peer dependencies are installed
  • Check TypeScript configuration compatibility

Getting Help

If you encounter issues:

  1. Check our Troubleshooting Guide
  2. Search existing issues
  3. Create a new issue

Next Steps