atm

Atomix

v0.4.6

    1. Home
    2. Guides
    3. Live Editor

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.

Real-time theme editing with instant preview

Theme Live Editor

Edit themes visually or with JSON, see changes instantly, and export your customized theme for use in your application.

Theme Live Editor Component

ThemeLiveEditor provides a powerful editing environment with visual controls, JSON editor, live preview, and export capabilities for rapid theme development.

Overview

The ThemeLiveEditor component combines visual editing tools with a JSON editor to provide a flexible theme creation experience. Changes are reflected instantly in the preview, making it easy to experiment and iterate quickly.

Key Features

  • Visual Editor - Edit common properties with color pickers and inputs
  • JSON Editor - Advanced editing with syntax highlighting and validation
  • Live Preview - Instant updates as you make changes
  • Export Theme - Download theme as JSON file
  • Copy to Clipboard - Copy theme JSON for quick integration
  • Syntax Validation - Real-time error checking
  • Debounced Updates - Smooth editing experience

Basic Usage

Simple Editor

TSX
1import { ThemeLiveEditor } from '@shohojdhara/atomix/theme/devtools'; 2import { createTheme } from '@shohojdhara/atomix/theme'; 3 4const initialTheme = createTheme({ 5 name: 'My Theme', 6 palette: { 7 primary: { main: '#7AFFD7' }, 8 secondary: { main: '#FF5733' }, 9 }, 10}); 11 12function App() { 13 const handleThemeChange = (newTheme) => { 14 console.log('Theme updated:', newTheme); 15 }; 16 17 return ( 18 <ThemeLiveEditor 19 initialTheme={initialTheme} 20 onChange={handleThemeChange} 21 /> 22 ); 23}
23 lines502 characters

With State Management

TSX
1import { useState } from 'react'; 2 3function ThemeBuilder() { 4 const [theme, setTheme] = useState(initialTheme); 5 6 return ( 7 <div> 8 <ThemeLiveEditor 9 initialTheme={theme} 10 onChange={setTheme} 11 /> 12 13 <button onClick={() => saveTheme(theme)}> 14 Save Theme 15 </button> 16 </div> 17 ); 18}
18 lines331 characters

Props API

PropTypeDefaultDescription
initialThemeThemeRequiredInitial theme to edit
onChange(theme: Theme) => voidRequiredCallback when theme changes
classNamestring-Custom CSS class name
styleCSSProperties-Inline styles object

Editor Features

Visual Editor

The visual editor provides intuitive controls for common theme properties:

  • Color Pickers - Visual color selection for palette colors
  • Font Selectors - Choose from available font families
  • Size Inputs - Adjust font sizes, spacing, and other numeric values
  • Preset Options - Quick selection of common values

JSON Editor

For advanced editing, switch to JSON mode:

  • Syntax Highlighting - Color-coded JSON for readability
  • Auto-completion - Suggestions for property names
  • Error Detection - Real-time validation and error highlighting
  • Format/Beautify - Auto-format JSON for consistency

Export Options

Export your theme in multiple ways:

  • Download JSON - Save theme as a .json file
  • Copy to Clipboard - Copy theme JSON for quick pasting
  • Generate Code - Get createTheme() code snippet

Advanced Examples

Theme Builder Application

Create a complete theme builder with save/load functionality:

TSX
1import { ThemeLiveEditor, ThemePreview } from '@shohojdhara/atomix/theme/devtools'; 2import { useState } from 'react'; 3 4function ThemeBuilderApp() { 5 const [theme, setTheme] = useState(defaultTheme); 6 const [savedThemes, setSavedThemes] = useState([]); 7 8 const handleSave = () => { 9 const themeName = prompt('Enter theme name:'); 10 if (themeName) { 11 setSavedThemes([ 12 ...savedThemes, 13 { name: themeName, theme: theme } 14 ]); 15 } 16 }; 17 18 const handleLoad = (savedTheme) => { 19 setTheme(savedTheme.theme); 20 }; 21 22 return ( 23 <div className="theme-builder"> 24 <div className="sidebar"> 25 <h3>Saved Themes</h3> 26 {savedThemes.map((saved) => ( 27 <button 28 key={saved.name} 29 onClick={() => handleLoad(saved)} 30 > 31 {saved.name} 32 </button> 33 ))} 34 </div> 35 36 <div className="editor"> 37 <ThemeLiveEditor 38 initialTheme={theme} 39 onChange={setTheme} 40 /> 41 <button onClick={handleSave}>Save Theme</button> 42 </div> 43 44 <div className="preview"> 45 <ThemePreview theme={theme} /> 46 </div> 47 </div> 48 ); 49}
49 lines1167 characters

Collaborative Editing

Sync theme changes across multiple users:

TSX
1import { useEffect, useState } from 'react'; 2 3function CollaborativeThemeEditor({ roomId }) { 4 const [theme, setTheme] = useState(defaultTheme); 5 6 // Sync with backend 7 useEffect(() => { 8 const socket = connectToRoom(roomId); 9 10 socket.on('theme-update', (newTheme) => { 11 setTheme(newTheme); 12 }); 13 14 return () => socket.disconnect(); 15 }, [roomId]); 16 17 const handleChange = (newTheme) => { 18 setTheme(newTheme); 19 // Broadcast to other users 20 broadcastThemeUpdate(roomId, newTheme); 21 }; 22 23 return ( 24 <ThemeLiveEditor 25 initialTheme={theme} 26 onChange={handleChange} 27 /> 28 ); 29}
29 lines620 characters

Undo/Redo Support

Add undo/redo functionality to the editor:

TSX
1function ThemeEditorWithHistory() { 2 const [history, setHistory] = useState([defaultTheme]); 3 const [currentIndex, setCurrentIndex] = useState(0); 4 5 const currentTheme = history[currentIndex]; 6 7 const handleChange = (newTheme) => { 8 const newHistory = history.slice(0, currentIndex + 1); 9 setHistory([...newHistory, newTheme]); 10 setCurrentIndex(newHistory.length); 11 }; 12 13 const undo = () => { 14 if (currentIndex > 0) { 15 setCurrentIndex(currentIndex - 1); 16 } 17 }; 18 19 const redo = () => { 20 if (currentIndex < history.length - 1) { 21 setCurrentIndex(currentIndex + 1); 22 } 23 }; 24 25 return ( 26 <div> 27 <div className="controls"> 28 <button onClick={undo} disabled={currentIndex === 0}> 29 Undo 30 </button> 31 <button onClick={redo} disabled={currentIndex === history.length - 1}> 32 Redo 33 </button> 34 </div> 35 36 <ThemeLiveEditor 37 initialTheme={currentTheme} 38 onChange={handleChange} 39 /> 40 </div> 41 ); 42}
42 lines1001 characters

Best Practices

Start with Visual Editor

Use the visual editor for quick adjustments to common properties. Switch to JSON mode for advanced customization or bulk edits.

Save Frequently

Export your theme regularly during development. Use the copy to clipboard feature for quick backups or sharing with team members.

Validate Before Exporting

The editor validates syntax in real-time, but always test your exported theme with ThemeInspector to catch any logical errors or accessibility issues.

Performance Note

Updates are debounced for smooth editing. The onChange callback fires after a short delay to prevent excessive re-renders during rapid typing.

Keyboard Shortcuts

ShortcutAction
Cmd/Ctrl + SExport theme
Cmd/Ctrl + CCopy theme JSON to clipboard
Cmd/Ctrl + FFormat JSON (in JSON mode)
Cmd/Ctrl + ZUndo (if implemented)
Cmd/Ctrl + Shift + ZRedo (if implemented)

Related Tools

Combine ThemeLiveEditor with other devtools:

✨ Try Live Editor - Interactive theme editor example→ Theme Preview - Preview your edited theme→ Theme Inspector - Validate your theme→ Theme Studio - Full theme creation environment← Back to Devtools Overview