Solar Design System Documentation

A complete guide to getting started with Solar Design System

🚀 Get Started with SOLAR

Access the complete React + TypeScript design system with live component showcase, energy-aware components, and full documentation

📦 Two Ways to Use SOLAR

⚛️
React + TypeScript (Recommended)
Full component library with live showcase, energy-aware components, and Tailwind CSS. Clone from GitHub and start building.
🌐
Static HTML/CSS
This website! Reference implementation showing design principles, framework, and guidelines.
💡
Recommended for Development: Clone the React version from GitHub. It includes 12+ components, 5 energy-aware components, full TypeScript support, and a live component showcase.

What is Solar Design System?

Solar Design System is a comprehensive, energy-efficient design system built for modern web applications. Available as a React + TypeScript component library, SOLAR features a dark-first theme optimized for OLED displays, system-first typography, energy-aware components, and a carefully crafted color palette.

🌑
Dark-First Design
Optimized for OLED energy savings with pure black backgrounds
Energy-Aware Components
5 components that make environmental costs visible and controllable
🎨
7 Accent Colors
Comprehensive color system with semantic meaning
📱
Fully Responsive
Mobile-first approach
Accessible
WCAG AA compliant contrast ratios
Performance-Focused
System fonts, no shadows, minimal rendering
🎯
Type-Safe
Full TypeScript support with React 18
📚
12+ Components
Complete component library with live showcase

Installation Steps

Get the React + TypeScript version from GitHub:

  1. Clone or Download from GitHub

    Visit github.com/ravipalwe/solardesignsystem and clone or download the repository.

    BASH
    git clone https://github.com/ravipalwe/solardesignsystem.git cd solardesignsystem
  2. Install Dependencies

    Open your terminal in the project folder and run:

    BASH
    npm install

    This will install all required packages (React, Vite, Tailwind CSS, TypeScript, etc.)

  3. Start Development Server

    Run the development server:

    BASH
    npm run dev

    You should see output like:

    OUTPUT
    VITE v5.x.x ready in xxx ms ➜ Local: http://localhost:5173/
  4. View Design System

    Open your browser and navigate to http://localhost:5173

    You'll see the complete design system showcase with all components, design tokens, and energy-aware components in action!

Using Components

All components are showcased in the React app at src/components/DesignSystem.tsx. The app has two views:

⚡ Energy-Aware View

Shows 5 planet-first components that make environmental costs visible:

🎨 Design System View

Complete showcase of all dashboard components, design tokens, and UI elements.

Usage in Your Project

You can:

1. Copy Component Code

Browse the showcase and copy the code for any component you need.

2. Use Tailwind Classes Directly

Apply design system classes directly in your components:

JSX
<button className="bg-accent-primary text-black rounded-button px-6 py-2.5 text-sm font-semibold hover:bg-accent-primary-dim transition-colors"> Click Me </button>

3. Reference Design Tokens

All design tokens are configured in tailwind.config.js. You can use them directly:

CSS
// Colors bg-accent-primary text-accent-solar-amber border-borders-subtle // Spacing p-6 (24px) gap-4 (16px) // Border Radius rounded-card (24px) rounded-button (9999px)

Color System

The design system includes 8 accent colors, each with semantic meaning:

Primary (Matcha)
#DDEE88
Solar Amber
#F59E0B
OLED Rose
#E11D48
Deep Teal
#0D9488
Purple
#A78BFA
Cyan
#22D3EE
Success
#34D399
💡
Color Usage Guidelines:
  • Primary: Use for CTAs, active states, key highlights
  • Solar Amber: Use for warnings
  • OLED Rose: Use for errors and negative changes
  • Deep Teal: Use for informational content
  • Success: Use for positive metrics and success states

🎨 Live Component Showcase

See the components in action with their code. Each example shows the rendered component followed by the code you can copy:

Buttons

PREVIEW
CODE
JSX
<button className="bg-accent-primary text-black rounded-button px-6 py-2.5 text-sm font-semibold hover:bg-accent-primary-dim transition-colors"> Primary Button </button>
PREVIEW
CODE
JSX
<button className="bg-transparent text-text-primary border border-borders-contrast rounded-button px-6 py-2.5 text-sm font-semibold hover:bg-background-cardSurfaceHover transition-colors"> Secondary Button </button>

Cards

PREVIEW

Card Title

This is a simple card with title and description. Cards are great for organizing content.

CODE
JSX
<div className="bg-background-cardSurface border border-borders-subtle rounded-card p-6"> <h4 className="text-lg font-semibold mb-2">Card Title</h4> <p className="text-sm text-text-secondary mb-4"> This is a simple card with title and description. </p> <button className="bg-accent-primary text-black rounded-button px-4 py-2 text-xs font-semibold"> Action </button> </div>
PREVIEW
Total Views
2,543
↑ 12% from last week
CODE
JSX
<div className="bg-background-cardSurface border border-borders-subtle rounded-card p-5"> <div className="text-xs text-text-secondary mb-2">Total Views</div> <div className="text-3xl font-bold text-text-primary mb-1">2,543</div> <div className="text-xs text-accent-success">↑ 12% from last week</div> </div>

Badges

PREVIEW
✓ Success ⚠ Warning ✕ Error ℹ Info
CODE
JSX
// Success Badge <span className="inline-flex items-center px-3 py-1 rounded-badge text-xs font-semibold text-accent-success" style={{ backgroundColor: 'rgba(52, 211, 153, 0.2)' }}> ✓ Success </span> // Warning Badge <span className="inline-flex items-center px-3 py-1 rounded-badge text-xs font-semibold text-accent-solar-amber" style={{ backgroundColor: 'rgba(245, 158, 11, 0.2)' }}> ⚠ Warning </span> // Error Badge <span className="inline-flex items-center px-3 py-1 rounded-badge text-xs font-semibold text-accent-oled-rose" style={{ backgroundColor: 'rgba(225, 29, 72, 0.2)' }}> ✕ Error </span>

Input Fields

PREVIEW
CODE
JSX
<div> <label className="block text-xs font-semibold text-text-primary mb-2"> Email Address </label> <input type="email" placeholder="your@email.com" className="w-full bg-background-badgeNeutral border border-borders-subtle rounded-input px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary transition-colors" /> </div>
PREVIEW
CODE
JSX
<div> <label className="block text-xs font-semibold text-text-primary mb-2"> Message </label> <textarea placeholder="Enter your message..." rows="3" className="w-full bg-background-badgeNeutral border border-borders-subtle rounded-input px-4 py-2.5 text-sm text-text-primary focus:outline-none focus:border-accent-primary transition-colors resize-vertical" /> </div>

Alert Boxes

PREVIEW
Success!
Your changes have been saved successfully.
Info:
This is an informational message for users.
Warning:
Please review your input before proceeding.
CODE
HTML
// Success Alert <div className="alert alert-success"> <div className="alert-icon">✓</div> <div> <strong>Success!</strong><br /> Your changes have been saved successfully. </div> </div> // Info Alert <div className="alert alert-info"> <div className="alert-icon">ℹ</div> <div> <strong>Info:</strong><br /> This is an informational message. </div> </div> // Warning Alert <div className="alert alert-warning"> <div className="alert-icon">⚠</div> <div> <strong>Warning:</strong><br /> Please review before proceeding. </div> </div>
💡
Pro Tip: All these components automatically adapt to dark mode! Toggle the dark mode button in the navigation to see how they transform for OLED energy savings. You can copy any code block by selecting and copying the text.

Available Components

The React design system includes 12+ pre-built components:

⚡ Energy-Aware (5)
EnergyModeIndicator, CarbonFootprint, ClickToLoadMedia, GridStatusBadge, DataCostBadge
Dashboard Components
Header, StatsGrid, ChartCard, RecentActivity, TopContent
Buttons
Primary, Secondary, Time Range buttons with hover states
Input Fields
Text inputs with focus states and validation
Form Controls
Select, Checkbox, Radio, Switch components
Navigation
Tabs, Navigation items with active states
Feedback
Alerts, Badges, Tooltips for user feedback
Cards
Stat cards, Chart cards, Activity cards, Content cards

Documentation

Complete documentation is included in the GitHub repository:

💡
All documentation is in the repository: Visit GitHub to access complete guides, component docs, and the live React showcase.

Build for Production

When you're ready to build your project:

npm run build

The production files will be in the dist folder.

Preview the production build:

npm run preview

Tips & Best Practices

Use Design Tokens
Always use tokens from tailwind.config.js instead of hardcoding values. This ensures consistency and makes updates easier.
Check Component Showcase
View src/components/DesignSystem.tsx to see all components with their code. Copy and customize as needed.
Maintain Accessibility
Always ensure proper contrast ratios and include focus states for interactive elements. The design system follows WCAG AA standards.

Ready to Get Started?

Clone the React design system from GitHub and start building planet-first interfaces today.

View on GitHub