An example Next.js app that demonstrates adaptive loading using React Adaptive Hooks and HTTP Client Hints. The UI progressively adapts to each user’s device and network conditions by switching between low‑fidelity and high‑fidelity experiences for faster, more resilient performance.
Inspired by Next Episode.
👉 Live demo: adaptive-loading.web.app/next-show-adaptive-loading/
This TV shows browser uses the TMDB data API and adapts rendering based on:
- Effective connection type (e.g., 2G → lo‑fi, 4G/Wi‑Fi → hi‑fi)
- Available device memory
- Client Hints provided by the browser
Built with Next.js and React Adaptive Hooks.
- Adaptive UI quality based on network and memory conditions
- Uses
react-adaptive-hooks(network and memory hooks) - Supports Client Hints for server‑side adaptation where available
- Progressive enhancement patterns for resilient UX
- Next.js app structure with demo pages and components
The app reads device and network signals to decide whether to prioritize speed or fidelity:
- Network info via
useNetworkStatus()fromreact-adaptive-hooksmaps effective connection type to a quality tier - Memory info via
useMemoryStatus()detects low‑memory scenarios - Client Hints (when sent by the browser) inform server‑side decisions in Next.js
These signals drive conditional rendering, image choices, and content density to keep the experience fast on constrained devices while delivering richer UI on capable ones.
git clone https://api.glitch.com/git/anton-karlovskiy-next-show-adaptive-loading
cd next-show-adaptive-loading-prototype
npm install
# Start development server
npm run dev
# Production build and run
npm run build
npm start
Note: This project targets Next.js 9.x for demo purposes and may use legacy APIs. For modern Next.js projects, adapt the concepts to your current version.
npm run dev: Start the Next.js dev servernpm run build: Build for productionnpm start: Start the production servernpm run deploy: Deploy to Firebase (copiesbuildtofunctions/and runsfirebase deploy)
- Next.js 9.x, React 16.x
react-adaptive-hooksfor network and memory status- Express (custom server)
- Firebase Hosting + Cloud Functions (optional deploy target)
See how adaptive signals are used in the app:
utils/hooks.js on Glitch: https://glitch.com/edit/#!/anton-karlovskiy-next-show-adaptive-loading?path=utils/hooks.js:26:102
- App: https://anton-karlovskiy-next-show-adaptive-loading.glitch.me/
- Project: https://glitch.com/~anton-karlovskiy-next-show-adaptive-loading/
Next.js adaptive loading, React Adaptive Hooks, Client Hints, effective connection type, network information, device memory, progressive enhancement, performance optimization, resilient UX, TMDB demo, low‑fidelity high‑fidelity rendering, slow network optimization, memory‑aware UI, Next.js performance demo