A practical React Router starter that demonstrates clear route-based navigation, lazy-loaded pages, accessible controls, and a responsive static frontend layout.
- BrowserRouter routes for home, about, contact, legal pages, and not found states
- Lazy-loaded pages with a Suspense loading state
- Fixed header with scroll-aware visibility and a mobile navigation drawer
- Route scroll reset, keyboard support, focus states, and GitHub Pages fallback
- Local favicon, logo, social preview, and feature image assets
- React 18
- React Router DOM
- Vite
- styled-components
- React Icons
npm install
npm run devOpen the repository base path shown by Vite, usually /basic-react-router-app/.
Production checks and deployment:
npm run lint
npm run build
npm run preview
npm run deployThe deploy command creates a 404.html fallback for GitHub Pages so direct links to nested routes keep working. It works on Windows, macOS, and Linux.
- Add more reusable route examples and nested layouts
- Add small form and data-fetching demos
- Add theme preferences and richer page transitions
screenshot.png- current home-screen screenshotpublic/router-pattern.jpg- local feature panel imagepublic/preview.png- social sharing previewpublic/logo.png- application logopublic/favicon.ico- browser favicon
MIT License
- Portfolio: https://www.ashishranjan.net/
- GitHub: https://github.com/a2rp
- CodePen: https://codepen.io/ash1198
- LinkedIn: https://www.linkedin.com/in/aashishranjan
- Facebook: https://www.facebook.com/theash.ashish/
- YouTube: https://www.youtube.com/@ashishranjan-ashz?sub_confirmation=1
- Email: ash.ranjan09@gmail.com
- Support: https://a2rp-donation-page.netlify.app/
- Buy Me A Coffee: https://buymeacoffee.com/a2rp
- Patreon: https://patreon.com/a2rp
