Skip to main content

What are Themes?

In EverShop, themes control the visual presentation and user interface of your store. Themes are separate from business logic (which lives in extensions) and contain only page components and styling.
Themes in EverShop are built with React and TypeScript, and use Tailwind CSS for styling.

Theme Architecture

Directory Structure

Each theme follows a standardized structure:

Page Component Structure

Theme components are organized by area and page type:
  • all/ - Components that appear on every page (Header, Footer, Navigation)
  • homepage/ - Homepage-specific sections (Hero, Features, Featured Products)
  • account/ - Account management pages (Login, Register, Dashboard)
  • catalog/ - Product listing and detail pages
  • checkout/ - Checkout flow components

Component Exports

Every page component in a theme must export specific values:

Area IDs

Components are placed in different areas of the page:
  • header - Top of every page
  • content - Main content area
  • footer - Bottom of every page
  • sidebar - Side navigation or filters
Use sortOrder to control the exact position within an area. Lower numbers render first.

Activating a Theme

Themes are activated in config/default.json:
The theme name must match the directory name in themes/.

Development Workflow

Creating Components

  1. Create a new .tsx file in the appropriate area directory:
  2. Export the component with layout configuration:
  3. Build the theme:

Hot Reload

During development, use:
Changes to theme files will automatically rebuild and refresh.

Styling with Tailwind CSS

EverShop themes use Tailwind CSS utility classes:

Custom Colors

Define brand colors directly in your components:

Best Practice

Extract commonly used colors into CSS variables or Tailwind config for consistency across your theme.

TypeScript Configuration

Themes use TypeScript with React support. The tsconfig.json includes:

Type Safety

Define props interfaces for your components:

Data Fetching with GraphQL

Components can fetch data using GraphQL queries:

Theme vs Extensions

A complete EverShop store requires both a theme (for UI) and extensions (for functionality).

Next Steps

Ana's Supplements Theme

Explore a complete theme implementation

Styling Guide

Learn advanced styling techniques

Extensions Overview

Understand how extensions work

GraphQL Queries

Master data fetching in components