atm

Atomix

v0.4.6

    1. Home
    2. Guides
    3. Theme Preview

Getting Started
  • Introduction
  • Installation
  • Quick Start
  • Migration Guide
  • CLI Reference
Design Tokens
  • Overview
  • All Tokens
  • Colors
  • Spacing
  • Typography
  • Grid
  • Elevation
Styles System
  • Architecture
  • Customization
  • Utilities
  • API Reference
Layouts
  • Grid System
  • Masonry Grid
  • Responsive Patterns
  • Customization
  • Performance
Components
  • Overview
  • Guidelines
  • Accordion
  • AtomixGlass
  • Avatar
  • Badge
  • Breadcrumb
  • Button
  • ButtonGroup
  • Card
  • Checkbox
  • Date Picker
  • Dropdown
  • Form
  • Input
  • Modal
  • Progress
  • Radio
  • Rating
  • Select
  • Slider
  • Spinner
  • Tab
  • Textarea
  • Toggle
  • Tooltip
  • Upload
  • Block
  • Callout
  • Countdown
  • Hero
  • Icon
  • List
  • Messages
  • Navbar
  • Pagination
  • Popover
  • Steps
  • SectionIntro
  • Container
  • Grid
  • GridCol
  • Row
  • River
  • MasonryGrid
  • DataTable
  • EdgePanel
  • SideMenu
  • Nav
  • NavItem
  • NavDropdown
  • VirtualizedGrid
Guides
  • Theming Guide
  • AtomixGlass Performance
  • AtomixGlass Theming
  • Theme Studio
  • Devtools
  • Theme Inspector
  • Theme Preview
  • Theme Comparator
  • Live Editor
  • CLI Tool
  • Try Live Editor
  • Try Inspector
  • Try Preview
  • Try Comparator
  • AtomixGlass Playground
Examples
  • Common Patterns
  • Landing Page
API Reference
  • React API
  • JavaScript API
  • CSS API
CLI
  • Overview
  • User Guide
  • API Reference
  • Migration Guide
  • Security Guide
Resources
  • Roadmap
  • Changelog
  • Contributing

Atomix Design System

A comprehensive design system for building modern, accessible, and performant web applications with React and vanilla JavaScript.
GitHubTwitterDiscordNPM

Getting Started

IntroductionInstallationQuick StartTheming Guide

Documentation

ComponentsDesign TokensStyles SystemLayouts

Resources

GitHub Repository↗NPM Package↗Storybook↗API Reference

Community

ContributingRoadmapChangelogReport Issue↗

© 2026 Atomix Design System. Built with ❤️ by the Shohojdhara.

Live preview of themes with sample components

Theme Preview

Visualize your theme with color palettes, typography samples, and custom components. Test themes before deployment.

Theme Preview Component

ThemePreview provides a live preview environment for testing themes with sample components, color palettes, typography scales, and spacing visualizations.

Overview

The ThemePreview component creates a visual testing environment where you can see how your theme looks with real components. It displays color palettes, typography samples, spacing scales, and allows you to preview custom components.

✨ Try it now: Interactive Preview Example — Customize colors and visualize a theme with sample components.

Key Features

  • Theme Details - Display theme metadata and information
  • Color Palette - Visual representation of all theme colors
  • Typography Samples - Preview all font sizes, weights, and line heights
  • Spacing Scale - Visualize spacing tokens
  • Custom Components - Test theme with your actual components
  • Sample Rendering - Built-in sample components for quick testing

Basic Usage

Simple Preview

TSX
1import { ThemePreview } from '@shohojdhara/atomix/theme/devtools'; 2import { createTheme } from '@shohojdhara/atomix/theme'; 3 4const theme = createTheme({ 5 name: 'My Theme', 6 palette: { 7 primary: { main: '#7AFFD7' }, 8 secondary: { main: '#FF5733' }, 9 }, 10}); 11 12function App() { 13 return ( 14 <ThemePreview 15 theme={theme} 16 showDetails={true} 17 showPalette={true} 18 showTypography={true} 19 showSpacing={false} 20 /> 21 ); 22}
22 lines449 characters

With Custom Components

TSX
1import { Button, Card } from '@shohojdhara/atomix'; 2 3<ThemePreview theme={theme} showPalette={true}> 4 {/* Your custom components */} 5 <Button variant="primary">Test Button</Button> 6 <Card className="u-p-4"> 7 <h3>Test Card</h3> 8 <p>Testing theme with actual components</p> 9 </Card> 10</ThemePreview>
10 lines306 characters

Props API

PropTypeDefaultDescription
themeThemeRequiredTheme object to preview
showDetailsbooleantrueShow theme metadata and details
showPalettebooleantrueShow color palette visualization
showTypographybooleantrueShow typography samples
showSpacingbooleanfalseShow spacing scale visualization
childrenReactNode-Custom components to render with theme
classNamestring-Custom CSS class name
styleCSSProperties-Inline styles object

Advanced Examples

Theme Testing Suite

Create a comprehensive testing environment:

TSX
1import { ThemePreview } from '@shohojdhara/atomix/theme/devtools'; 2import { Button, Card, Input, Badge } from '@shohojdhara/atomix'; 3 4function ThemeTestingSuite({ theme }) { 5 return ( 6 <ThemePreview 7 theme={theme} 8 showPalette={true} 9 showTypography={true} 10 > 11 <div className="component-tests"> 12 <section> 13 <h3>Buttons</h3> 14 <Button variant="primary">Primary</Button> 15 <Button variant="secondary">Secondary</Button> 16 <Button variant="outline">Outline</Button> 17 </section> 18 19 <section> 20 <h3>Form Elements</h3> 21 <Input placeholder="Test input" /> 22 <Input type="email" placeholder="Email" /> 23 </section> 24 25 <section> 26 <h3>Cards</h3> 27 <Card className="u-p-4"> 28 <h4>Card Title</h4> 29 <p>Card content with theme applied</p> 30 </Card> 31 </section> 32 33 <section> 34 <h3>Badges</h3> 35 <Badge variant="primary">Primary</Badge> 36 <Badge variant="success">Success</Badge> 37 <Badge variant="error">Error</Badge> 38 </section> 39 </div> 40 </ThemePreview> 41 ); 42}
42 lines1169 characters

Storybook Integration

Add theme preview to Storybook stories:

TSX
1// .storybook/preview.tsx 2import { ThemePreview } from '@shohojdhara/atomix/theme/devtools'; 3 4export const decorators = [ 5 (Story, context) => { 6 const theme = context.globals.theme; 7 8 return ( 9 <ThemePreview 10 theme={theme} 11 showDetails={false} 12 showPalette={false} 13 > 14 <Story /> 15 </ThemePreview> 16 ); 17 }, 18]; 19 20// In your stories 21export const WithTheme = { 22 decorators: [ 23 (Story) => ( 24 <ThemePreview theme={myCustomTheme}> 25 <Story /> 26 </ThemePreview> 27 ), 28 ], 29};
29 lines543 characters

Multi-Theme Comparison

Preview multiple themes side by side:

TSX
1function MultiThemePreview() { 2 const themes = [lightTheme, darkTheme, customTheme]; 3 4 return ( 5 <div className="theme-grid"> 6 {themes.map((theme) => ( 7 <div key={theme.name} className="theme-preview-container"> 8 <h3>{theme.name}</h3> 9 <ThemePreview 10 theme={theme} 11 showPalette={true} 12 showTypography={false} 13 > 14 <Button>Test Button</Button> 15 <Card className="u-p-3">Sample Card</Card> 16 </ThemePreview> 17 </div> 18 ))} 19 </div> 20 ); 21}
21 lines553 characters

Common Use Cases

1. Theme Development

Use ThemePreview during theme creation to see changes in real-time:

  • Visualize color palette as you adjust values
  • Test typography scales with actual text samples
  • Preview components with new theme applied

2. Client Presentations

Show theme options to clients or stakeholders:

  • Display multiple theme variations
  • Preview with actual application components
  • Demonstrate light/dark mode options

3. Documentation

Include in theme documentation:

  • Show available theme options
  • Demonstrate theme customization
  • Provide interactive examples

Best Practices

Test with Real Components

Always preview themes with your actual application components, not just the default samples. This ensures the theme works correctly in your specific use cases.

Check All Variants

Test all component variants (primary, secondary, outline, etc.) to ensure consistent theming across your entire component library.

Verify Accessibility

Use the color palette view to check contrast ratios. Ensure text is readable against all background colors in your theme.

Performance Note

CSS variables are generated once and cached for performance. The preview updates smoothly even with complex themes.

Related Tools

Combine ThemePreview with other devtools:

→ Theme Inspector - Validate and debug themes→ Live Editor - Edit themes in real-time→ Theme Comparator - Compare theme versions← Back to Devtools Overview