Documentation Index
Fetch the complete documentation index at: https://mintlify.com/apursley2012/aurora-cosmos/llms.txt
Use this file to discover all available pages before exploring further.
Navigation is the primary wayfinding component for Aurora Cosmos. On large screens it appears as a slim glassmorphism sidebar on the left edge of the viewport that expands to reveal route labels when hovered. On small screens it collapses into a top bar with a hamburger button that opens a full-screen animated drawer. Both surfaces share the same route array and active-route logic, so they always stay in sync with the current URL.
Desktop Sidebar
The desktop sidebar is hidden below thelg breakpoint (hidden lg:flex) and mounted as position: fixed at z-index: 50 so it always overlays page content.
Collapsed state (w-20)
When the cursor is elsewhere on the page, the sidebar occupies only 80 px (
w-20). Each nav item displays only its icon — the text label exists in the DOM but is invisible (opacity-0).Expanded state (hover:w-64)
When the user hovers over the sidebar, Tailwind’s
group + group-hover: classes animate the sidebar to w-64 (256 px) over a 300 ms transition-all. Icon alignment shifts from centred to left-aligned (group-hover:items-start), and all label spans fade from opacity-0 to opacity-100 via group-hover:opacity-100..glass-panel utility (glassmorphism) with left, top, and bottom borders removed so only the right border creates a subtle dividing line:
Mobile Menu
On screens narrower thanlg, a fixed top bar takes over. It displays the logo dot on the left and a hamburger/close button (Menu / X from lucide-react) on the right. Tapping the button toggles a boolean state value.
isOpen is true, AnimatePresence mounts a full-screen motion.div overlay over bg-space-900/95 backdrop-blur-xl:
AnimatePresence ensures the exit animation (opacity: 0, y: -20) plays before the overlay is removed from the DOM. Tapping any route link sets isOpen to false, triggering that exit.
Routes
The route configuration lives in a module-level constantua. Each entry is an object with a path, a label, and a lucide-react icon component reference.
| Path | Label | Icon |
|---|---|---|
/ | Home | rocket |
/about | About | user |
/projects | Projects | briefcase |
/skills | Skills | code-xml |
/writing | Writing | pen-tool |
/case-studies | Case Studies | file-text |
/contact | Contact | mail |
ua.map() in both the desktop sidebar and the mobile drawer, so both surfaces always reflect the same list.
Active Route Indicator
Navigation calls useLocation() from react-router-dom to get the current pathname and compares it to each route’s path. A matched route receives text-aurora-turquoise; unmatched links are text-slate-400 and gain hover:text-white hover:bg-white/5.
The active indicator is a motion.div with a shared layoutId:
layoutId="activeNav", Framer Motion’s layout animation automatically slides the 4 px aurora-turquoise bar from the previous active item to the new one whenever the route changes — no manual animation code is required.
Logo Dot
The desktop logo is an 8 × 8 (32 px) circle rendered at the top of the sidebar:animate-pulse and carries the .box-glow utility for the aurora glow effect. The mobile version is a slightly smaller 6 × 6 (24 px) variant without the animate-pulse.
Footer Label
At the bottom of the desktop sidebar (below the nav links), the system status string renders in monospace:opacity-0) and fades in as part of the same group-hover transition that reveals the nav labels. It is not rendered in the mobile menu.
Adding a Route
Add an entry to the ua array
Open
components/Navigation.js and append your route to the ua array. Choose an icon from lucide-react.Create the page component
Add a new file for the page component and export a default React component.
Register the route in the router
Import the new page and add a
<Route> element to your router configuration.No Props
Navigation accepts no props. It reads its own location via useLocation() internally and renders both the desktop sidebar and the mobile top bar / drawer within a single <>…</> fragment. Mount it once in the app shell — it handles all breakpoints by itself.
Navigation uses NavLink from react-router-dom for all route links. It must be rendered inside a React Router context (i.e., inside <BrowserRouter> or <RouterProvider>). Rendering it outside a router context will throw a runtime error.