TheDocumentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/full-moon/llms.txt
Use this file to discover all available pages before exploring further.
Layout component is the single root wrapper rendered for every route in Full Moon. It stacks the midnight background, two fixed atmospheric overlay layers (fog and starfield), the custom <Cursor />, the site <Navigation />, and a Framer Motion–animated <main> that fades each page in and out as the user navigates. Because it sits at the top of the React tree, any visual primitive that must persist across page transitions — the background, the cursor, the nav bar — lives here rather than inside individual page components.
Props
Layout accepts no props. It is registered as the route element that wraps all page routes in the router definition, so React Router controls when it mounts and which child route is active — no external configuration is needed.
Composition
The component builds up the full-screen canvas by layering seven distinct children inside a single root<div>:
1. Root <div>
bg-midnight-base applies the deep navy-black background color (#0a0e1a). text-witch-teal-glow sets the default text color to teal (#2dd4bf) so all downstream text inherits the on-brand palette without explicit coloring. relative overflow-hidden establishes the stacking context and prevents the fixed atmospheric layers from causing a horizontal scroll bar on narrow viewports.
2. Fog layer
z-0. The bg-fog class applies a CSS background (typically a radial gradient or low-opacity texture) that softens the hard midnight background and gives the canvas atmospheric depth. It is positioned fixed so it never scrolls away as the page grows taller.
3. Starfield layer
z-0 stacking level. The starfield class drives a CSS animation or background image that produces a field of faint, twinkling stars across the entire viewport. Like the fog layer, it is decorative-only and never scrolls with page content.
4. <Cursor />
z-[100] inside its own container, renders above every other element in the layout. It replaces the default OS cursor with a glowing teal orb, a precise white dot, and stochastic trailing spark particles. See the Cursor component docs for a full breakdown.
5. <Navigation />
Layout rather than inside individual page components, the nav never unmounts during client-side navigation. See the Navigation component docs for the full route table and bundling details.
6. <motion.main>
<main> element that wraps all page content. On every route transition, the initial → animate → exit sequence produces a 500 ms cross-fade: the incoming page fades in from fully transparent, and the outgoing page (when paired with <AnimatePresence> at the router level) fades out simultaneously. z-10 ensures page content renders above the z-0 atmospheric layers.
<AnimatePresence> must wrap the router outlet at the top of the React tree for exit animations to fire. Without it, Framer Motion has no mechanism to delay unmounting the outgoing page component, so the exit: { opacity: 0 } transition is skipped entirely and pages snap out instantly instead of fading.<Outlet />
<Outlet /> renders whichever child route component is currently matched. This is the only part of the tree that changes between navigations — everything above it (background, cursor, nav) remains mounted and stable.
Usage
RegisterLayout as the parent route element in your router definition. All page routes become children of this one entry so they automatically inherit the full visual shell:
The
pointer-events-none class on both the fog and starfield layers is critical. Without it, those fixed-position <div> elements would sit on top of the page content in the event-capture phase and silently absorb all mouse clicks, hover events, and scroll interactions — making the entire site appear non-interactive even though the DOM is fully rendered.