Components aren't complex. They're composed.

Learn the few primitives that compose every interface. Nothing feels like magic again.

Submit
Dark mode
Emailyou@example.com
DesignCodePreview
One-time purchase. Yours forever.
Playground
import { useRef } from "react";
import { useRovingFocus } from "./hooks";

export function RovingRing({ items }) {
  const containerRef = useRef(null);
  const { activeIndex, onKeyDown } =
    useRovingFocus(items.length);

  return (
    <div
      ref={containerRef}
      role="radiogroup"
      onKeyDown={onKeyDown}
      style={{ display: "flex", gap: 6 }}
    >
      {items.map((item, i) => {
        const isActive = i === activeIndex;
        return (
          <button
            key={item.id}
            tabIndex={isActive ? 0 : -1}
            aria-checked={isActive}
            style={{
              width: 40,
              height: 40,
              display: "flex",
              alignItems: "center",
              justifyContent: "center",
              borderRadius: 8,
              border: isActive
                ? "2px solid #1C1917"
                : "1px solid #E7E5E4",
              background: isActive
                ? "#1C1917" : "#FFFFFF",
              color: isActive
                ? "#FAFAF9" : "#57534E",
              fontSize: 14,
              fontWeight: 500,
              fontFamily: "system-ui, sans-serif",
              cursor: "pointer",
              outline: "none",
              transition: "all 150ms ease",
            }}
          >
            {item.label}
          </button>
        );
      })}
    </div>
  );
}
What's Inside

One component, three layers deep.

01

Design Rationale

Why it's shaped this way. The decisions and trade-offs behind every piece.

02

Anatomy & Variants

Every part labeled, every state mapped. See how it all fits together.

03

Build It

From the inside out to production code. Accessible patterns you can actually ship.

<button /> (RENDERED CHILD)01_SLOT (VIRTUAL WRAPPER)...props02_A11Y (FOCUS, KEYBOARD NAV)03_POSITION_ENGINE04_PRESENCE_ANIM05_MENU_WITH_SUB
Progress0%
Chapters0/34
Words0.0K
Images1

What's inside.

0 of 34 chapters written
1. Radix Foundations
0/4
Primitive & asChild / Slot pattern
Context utilities & useControllableState
Collection pattern & DOM-order tracking
Portal & SSR hydration patterns
2. Focus Management
0/4
FocusScope & focus trapping
FocusGuards & programmatic focus
RovingFocusGroup & tabindex strategy
DismissableLayer & outside events
3. Animation & Overlays
0/4
Presence & animation state machine
Dialog composition & scroll lock
Menu & pointer grace areas
Popover & modal vs non-modal
4. Floating UI — CorePro
0/4
computePosition & platform abstraction
Middleware pipeline & reset mechanism
offset / flip / shift deep dive
autoUpdate & detection strategies
5. Floating UI — ReactPro
0/4
useFloating & useState+useRef dual pattern
FloatingTree & nested floating hierarchy
useDismiss, useHover & safePolygon
Virtual elements & context menus
6. Base UI IntegrationPro
0/3
react-popper & compound component API
useAnchorPositioning wrapper
Collision avoidance API & invalid combos
Common Questions
{

}
A Note

Why this guide exists

I’ve been fascinated by design system implementation since 2023 — digging into how components are built from scratch.

Not everyone needs to understand what’s under the hood, and it’s a time-consuming pursuit. But I found it genuinely fun.

This guide is for readers who want to understand how components are really made — the secret sauce inside. I wanted to create the resource I wish I’d had when I was just starting out.

Every chapter follows the same rhythm: why this component exists, how to use it, how to build a minimal version yourself, and further references to explore. If you’ve ever stared at a 600-line hook and wondered how anyone arrived at that, this guide was written for you.

J.H. SuAuthor, component.guide
Newsletter

Stay in the loop.

Early chapters, progress updates, and the occasional deep-dive into a component that surprised me. No spam, no fluff — just the good stuff.

No spam, ever. Unsubscribe anytime.