When I revamped this website into a fullstack Next.js app, I made a simple decision: build a small UI kit inside the repo.
Not a “framework”, not a massive design system just a set of reusable primitives that keep the UI consistent and easy to evolve. Visit this page to try it.
Why I didn’t use a big UI library
UI libraries are great, but for a personal site I wanted:
- Consistency: one design language across
/,/blog,/tools, and/admin. - Control: I can tweak spacing, colors, and behavior without fighting defaults.
- Performance: fewer dependencies and less runtime cost.
- Accessibility by default: keyboard focus, proper labels, sensible semantics.
- Portability: components that can be extracted later (Storybook-ready).
How it’s organized in this repo
I split UI into two layers:
components/ui/: reusable primitives (portable). Examples: buttons, cards, modal, select, datetime picker.components/shared/: app-aware shared components. Examples: dev tools context menu, Turnstile widget, theme assistant, toast form wrapper.
This makes it easier to keep the UI kit clean: components/ui doesn’t depend on routes, DB, or server actions.
What I actually built
The goal is to cover the “boring but important” UI that shows up everywhere:
- Buttons with consistent sizes/variants and good focus states.
- Cards and layout wrappers to keep spacing predictable.
- Modal that supports dialogs and image previews.
- Select with a popover, keyboard-friendly behavior, and scrollable menus.
- DateTimePicker that’s compact, works for date/time/range, and doesn’t break responsive layouts.
- Rich text renderer/editor used in the admin CMS (so writing posts feels good).
I also created a /showcase page so I can see all UI primitives in one place and catch regressions quickly.
A small example: consistency pays off
When every form uses the same primitives, improvements scale:
- Better spacing once → better spacing everywhere.
- One accessibility fix → applied across modules (posts, projects, guestbook, hire-me, etc).
- One responsive tweak → no “random” breakpoints scattered across the codebase.
Even something as small as a shared button style removes a lot of design drift over time.
The rule I follow
If a component is meant to be reused, it should:
- Be TypeScript-first (clear props, sane defaults).
- Be responsive by design (no hardcoded widths; allow wrapping and overflow rules).
- Be accessible (labels, focus rings, keyboard support).
- Avoid leaking app concerns (URLs, auth, server actions) into
components/ui.
That’s it. Small rules, big payoff.
If you’re building a portfolio or product site: don’t be afraid to write your own UI components. Start small, keep them consistent, and iterate like you would with any other part of the system.
