Back to Blog

Building This Site with Next.js and MUI

March 25, 2026
nextjs
mui
typescript

I wanted to rebuild my personal site with two goals: keep it simple, and use it as a place to experiment with MUI theming.

Why MUI?

I use Material UI on other projects, so having a sandbox for theme customization just makes sense. The theming system goes deeper than most people think. You can override every component's default props, style slots, and even add custom variants.

The Theme Switcher

The site has ten themes that show off different parts of MUI's customization. Hit the palette button in the bottom right to try them out.

Modern dark themes

These three are inspired by the dark UIs that are everywhere right now. I researched the actual color palettes from GitHub, VS Code, Vercel, Linear, Claude, and JetBrains to get the values right.

Light themes

Stylized dark themes

Each theme is one createTheme() call. Switching is just swapping which theme object gets passed to ThemeProvider. The selected theme is stored in a cookie so the server renders it correctly on the first load with no flash.

What I Learned

Typography restraint matters way more than I expected. My first pass had fontWeight: 700 on everything: headings, buttons, chips. I did some reading on type hierarchy and dropped to a 400/500 range. The whole site looked better right away.

If everything is bold, nothing is bold.

The other big thing was solving the theme flash on navigation. Storing the theme in localStorage meant the server always rendered the default theme first, then swapped after hydration. Moving to cookies fixed it. The server reads the cookie in layout.tsx and passes it to the ThemeProvider so SSR matches the client from the first byte.

Stack