This document describes the layout system in the Alexander Sullivan’s Portfolio project.
Implementation: GeneralLayout.tsx
Layouts define the structure and composition of pages and sections, ensuring consistent UI, navigation, and shared component behavior across the entire site.
Location: src/layouts/
The GeneralLayout component wraps all page content and provides a consistent structure:
flowchart TD
GeneralLayout["GeneralLayout<br/>(Main Wrapper)"]
GeneralLayout -->|Contains| Navbar
GeneralLayout -->|Contains| Main["Main Content<br/>(Flex Container)"]
GeneralLayout -->|Contains| Stars["StarsBackground"]
GeneralLayout -->|Contains| Cookie["CookieSnackbar"]
GeneralLayout -->|Contains| Footer
Main -->|Holds| PageContent["Page Content<br/>(Children)"]
import GeneralLayout from '@layouts/GeneralLayout';
export default function Page() {
return <GeneralLayout>{/* Page content here */}</GeneralLayout>;
}
sx propTo create a new layout variant:
src/layouts/ (e.g., BlogLayout.tsx).test.tsx file