Developer Theme Structure

Theme Structure

A theme is a folder of Blade templates that decides how a site looks. Sites in theme mode pick their theme in the admin, and one installation can hold any number of themes. This article covers the folder anatomy and creating a theme of your own.

Where themes live

Themes sit in the application root under themes/:

themes/
└── default/
    ├── theme.json
    ├── preview.png        (optional)
    ├── assets/
    └── views/
        ├── layouts/app.blade.php
        ├── default.blade.php
        ├── page/show.blade.php
        ├── post/show.blade.php
        ├── archive/show.blade.php
        ├── preview/nav.blade.php
        └── blocks/
            ├── text.blade.php
            ├── hero.blade.php
            └── ...

Every directory in themes/ is automatically registered as a Blade view namespace: themes/default/views/page/show.blade.php is addressable as themes.default::page.show. The theme list in the admin (site registration and Settings → Appearance) is simply the list of these directories.

The pieces

  • theme.json — a manifest with metadata:

    {
        "name": "Default",
        "version": "1.0.0",
        "author": "Laravix"
    }
    
  • preview.svg / preview.webp / preview.png / preview.jpg — an optional screenshot shown next to the theme in the admin's theme picker.

  • views/{type}/show.blade.php — the template for a content type (page, post, archive, plugin types). When a type has no template, views/default.blade.php renders instead — so a theme works even for content types it never heard of.

  • views/layouts/app.blade.php — the shared layout: <head> with SEO tags, header navigation, @yield('content'), footer. The default theme also defines @stack('head') and @stack('scripts'), which the builder content view uses to inject styles and scripts.

  • views/blocks/{key}.blade.php — one view per classic block type (text, hero, cards, columns, button, button_group, divider). Used when content was built from the classic block array rather than the visual builder — see Templates and View Data.

  • views/preview/nav.blade.php — optional partial used by the admin's live navigation preview to render just the navigation part.

  • views/docs/…, views/changelog/… — plugins first look for their views inside the active theme (themes.{theme}::docs.show) and fall back to their own bundled views, so a theme can restyle plugin pages.

Creating a theme

  1. Copy the default theme as a starting point:

    cp -r themes/default themes/mytheme
    
  2. Edit themes/mytheme/theme.json (name, version, author).

  3. Adjust the templates — start with layouts/app.blade.php.

  4. Optionally drop in a preview.png.

  5. In the admin, open Settings → Appearance and select the new theme. The change is live immediately.

Note: The default theme loads the stylesheet shipped with the core (Laravix::asset('app.css')public/vendor/laravix/app.css) plus Font Awesome from a CDN. Your own theme is free to bring its own asset pipeline — link whatever CSS/JS you build.

Themes and upgrades

php artisan laravix:upgrade never touches themes/ — the folder is yours. The default theme is published only once, during installation (the installer skips publishing when themes/default already exists). If you want a pristine copy of the default theme later, publish it manually:

php artisan vendor:publish --tag=laravix-theme
Laravix Documentation · 14.07.2026
Star on GitHub