Skip to Content
ReferenceTemplate Structure

Template Structure

Every Gymlium template follows a strict directory structure. The platform relies on this structure to discover and render your components correctly.

Required directory layout

templates/your-template-name/ ├── template.manifest.json # Template metadata ├── template.css # Global CSS custom properties ├── index.ts # Barrel file — all exports ├── Header/ │ ├── Header.tsx # Named export: Header │ └── Header.module.css ├── Footer/ │ ├── Footer.tsx # Named export: Footer │ └── Footer.module.css ├── Loading/ │ ├── Loading.tsx # Default export │ └── Loading.module.css ├── pages/ │ ├── home/ │ │ ├── HomeContent.tsx # Default export │ │ └── HomeContent.module.css │ ├── about/ │ │ ├── AboutContent.tsx # Default export │ │ └── AboutContent.module.css │ └── login/ │ ├── LoginContent.tsx # Default export │ └── LoginContent.module.css └── preview/ └── thumbnail.png # Marketplace listing image

Required files

FilePurposeExport pattern
template.manifest.jsonTemplate metadata and configurationN/A (JSON)
template.cssGlobal CSS custom properties for themingN/A (CSS)
index.tsBarrel file — single point of entry for all exportsSee below
Header/Header.tsxNavigation header componentNamed export: export function Header()
Footer/Footer.tsxSite footer componentNamed export: export function Footer()
Loading/Loading.tsxLoading indicator componentDefault export: export default function Loading()
pages/home/HomeContent.tsxHome page contentDefault export
pages/about/AboutContent.tsxAbout page contentDefault export
pages/login/LoginContent.tsxLogin page contentDefault export
preview/thumbnail.pngMarketplace preview image (path set in preview.thumbnail)N/A (image)

The barrel file (index.ts)

The barrel file is how the Gymlium platform discovers your components. It must follow this exact pattern:

// Layout components — named exports export { Header } from './Header/Header' export { Footer } from './Footer/Footer' // Loading — default re-export export { default as Loading } from './Loading/Loading' // Pages — default re-exports export { default as HomeContent } from './pages/home/HomeContent' export { default as AboutContent } from './pages/about/AboutContent' export { default as LoginContent } from './pages/login/LoginContent' // Optional pages (include only if you've built them) export { default as ServicesContent } from './pages/services/ServicesContent' export { default as BlogContent } from './pages/blog/BlogContent' export { default as ContactContent } from './pages/contact/ContactContent'

The barrel file export names must match exactly. Header and Footer are named exports. All page components and Loading are re-exported as named exports from default exports using the export { default as Name } pattern.

Component requirements

Header (named export)

// ✅ Correct — named export export function Header() { return <header>...</header> } // ❌ Incorrect — default export export default function Header() { return <header>...</header> }

The Header component receives no props. Use the useApp() and useAuth() hooks to access data.

// ✅ Correct — named export export function Footer() { return <footer>...</footer> }

Same rules as Header — named export, no props, use hooks for data.

Loading (default export)

// ✅ Correct — default export export default function Loading() { return <div className={styles.spinner}>...</div> }

The Loading component is shown while page content loads. It should be lightweight and visually consistent with your template’s design.

Page components (default export)

// ✅ Correct — default export export default function HomeContent() { return <main>...</main> }

Every page component must use a default export. The component name should match the pattern {PageName}Content (e.g. HomeContent, AboutContent, ServicesContent).

Optional page directories

Beyond the three required pages (home, about, login), you can include any of these optional pages:

DirectoryComponent nameDescription
pages/services/ServicesContentServices listing
pages/blog/BlogContentBlog post listing
pages/testimonials/TestimonialsContentClient testimonials
pages/pricing/PricingContentPricing plans
pages/schedule/ScheduleContentSession scheduling
pages/events/EventsContentEvents calendar
pages/contact/ContactContentContact form
pages/privacy/PrivacyContentPrivacy policy
pages/terms/TermsContentTerms of service
pages/transformations/TransformationsContentBefore/after gallery
pages/account/AccountContentUser account dashboard
pages/join/JoinContentRegistration page
pages/forgotPassword/ForgotPasswordContentPassword reset request
pages/verifyEmail/VerifyEmailContentEmail verification
pages/resetPassword/ResetPasswordContentPassword reset form

Each optional page follows the same pattern: a directory with a component file (default export) and its CSS module. Don’t forget to add the export to your barrel file.

Preview and assets directories

The preview/ directory holds your marketplace images:

  • thumbnail.png (required) — 1200×900px marketplace listing image, referenced in your manifest’s preview.thumbnail
  • Screenshots (at least one) — referenced in your manifest’s preview.screenshots array

Any other static assets your template needs (SVGs, decorative images, etc.) can live in an assets/ directory.

Keep asset file sizes reasonable. The total template package should be under 10 MB. Optimise images before including them.

Last updated on