How to add a new custom footer page
How to add a new custom page (e.g. /about-us)
/about-us)1. Create a new route
Create a new file routes/AboutPage.tsx (or you can create a folder routes/Footer/AboutPage.tsx if you prefer grouping footer pages).
// routes/AboutPage.tsx
import React from 'react';
import Layout from '~/layouts/Default';
export default function AboutPage() {
return (
<Layout>
<div className="container py-5">
<h1>About Us</h1>
<p>This is a custom page with your company information.</p>
</div>
</Layout>
);
}2. Register the route in vite.config.js
vite.config.jsIn your vite.config.ts, add the new route inside the defineRoutes(...) section:
If you're grouping it under routes/Footer/AboutPage.tsx, use:
3. Update the Footer.tsx component
Footer.tsx componentInstead of using raw <a href>, use <Link> from react-router-dom.
Edit your Footer.tsx to use a real URL:
First, import the
Linkcomponent:
Then update the navigation link:
Repeat the same for other static pages if needed. This ensures full SPA navigation with proper React routing (no full page reloads).
π Optional: Organizing Footer Pages
If you plan to add more pages like FAQ, Returns, etc., keep them under routes/Footer/ and map them like this:
Last updated
Was this helpful?
