Preview Component
ThePreview component is the main entry point for resume rendering.
Location: src/components/Preview/Preview.tsx:9
Functionality:
- Fetches selected template configuration
- Supports both built-in and custom templates
- Passes data to UniversalRenderer for rendering
- Custom templates (via
useCustomTemplateshook) - Built-in templates (
classic.json,modern.json,minimal.json)
UniversalRenderer
TheUniversalRenderer is the core rendering engine that applies template configurations.
Location: src/components/ResumeRenderer/UniversalRenderer.tsx:11
Props
Complete resume data object containing all sections
Template configuration defining theme, layout, and section variants
Template Configuration Structure
Theconfig object contains:
Theme settings including colors, typography, and spacingNested properties:
colors: Primary, secondary, background, text, borderstypography: Font family, base size, line heightspacing: Section gap, item gap, page padding
Layout configuration for single or two-column designsProperties:
type: “single-column” or “two-column”columns: Column width distribution (e.g., “30% 70%”)sidebarPosition: “left” or “right”
Section organizationProperties:
main: Array of section IDs for main content areasidebar: Array of section IDs for sidebar (two-column only)
Variant styles for each section (e.g., “default”, “minimal”, “timeline”, “compact”)
CSS Variable Injection
The UniversalRenderer injects theme values as CSS variables:Layout Rendering
Single Column Layout:Section Order Logic
The renderer respects user customization:- Sidebar sections: Defined in template configuration
- Main sections: All sections not in sidebar, in user’s preferred order
SectionRenderer
TheSectionRenderer component maps section IDs to their respective rendering components.
Location: src/components/ResumeRenderer/SectionRenderer.tsx:18
Props
Section identifier (e.g., “personal-info”, “experience”, “education”)
Complete resume data
Visual variant for the section (“default”, “minimal”, “timeline”, “compact”, “centered”)
Section Mapping
The renderer uses a switch statement to map sections:Section Components
Each section has its own rendering component that accepts data and a variant.HeaderSection
Location:src/components/ResumeRenderer/sections/HeaderSection.tsx:11
Renders personal information with contact details.
Variants:
- centered: Centers text and contact items
- minimal: Removes bottom border
- default: Left-aligned with border
- Responsive icon display using Lucide icons
- Conditional rendering of contact items
- Theme-aware styling via CSS variables
ExperienceSection
Location:src/components/ResumeRenderer/sections/ExperienceSection.tsx:10
Renders work experience entries.
Variants:
- default: Standard layout with company/position hierarchy
- minimal: Compact single-line header
- compact: Inline position/company/dates
- timeline: Date column on the left
Other Section Components
All section components follow a similar pattern:- Accept props: Data array and variant
- Return null if empty: Graceful handling of missing data
- Apply variant styles: Different layouts based on variant
- Use CSS variables: Theme-aware styling
src/components/ResumeRenderer/sections/:
EducationSection.tsxSkillsSection.tsxProjectsSection.tsxCustomSection.tsx
Preview/SectionRenderer
There’s also a simplifiedSectionRenderer in the Preview directory.
Location: src/components/Preview/SectionRenderer.tsx:8
This component maps section IDs to rendered output using a render function:
Key Concepts
Theme System
All preview components use CSS variables for theming, allowing templates to completely customize appearance without changing component code.Variant System
Each section can have different visual variants, controlled by the template configuration. This allows templates to apply different styles to different sections (e.g., timeline experience, minimal education).Responsive Section Order
The preview system respects user customization of section order while maintaining template structure for two-column layouts.Print-Ready Output
The preview uses standard A4 dimensions:- Width:
210mm - Min Height:
297mm - These dimensions ensure proper PDF export and printing

