Skip to content

emka.web.id

writing knowledge, recording civilization

Menu
  • Home
  • Tutorial
  • Search
Menu

The Death of Popper.js: Why CSS Anchor Positioning is the New Standard for Connected UI

Posted on November 25, 2026

We have spent the better part of a decade outsourcing our layout logic to JavaScript. If you wanted a tooltip to stay pinned to a button, a dropdown to follow a menu item, or a sliding “active” highlight to track a navigation bar, you reached for Popper.js or Floating UI. It was a necessary evil. We accepted the bundle size bloat and the main-thread layout thrashing because CSS simply didn’t have a way to say, “Put this element right here, relative to that other element over there.”

In her recent exploration of “Connected Buttons,” Ania Kubów highlights a tectonic shift in how we approach these interfaces. We are moving away from the getBoundingClientRect() era and into the era of the CSS Anchor Positioning API. This is not just a new property; it is a fundamental rethinking of the relationship between elements in the DOM.

The Technical Mechanism: How Anchoring Actually Works

The core of the “connected” button effect relies on two distinct roles: the Anchor and the Target. Traditionally, to make a background highlight “slide” between buttons, we had to calculate offsets in JavaScript and apply transform: translateX() manually. With Anchor Positioning, the browser handles the geometry.

To implement this, you first designate your buttons as anchors. Each button gets a unique identifier using the anchor-name property. It is important to note that these names must follow the “dashed-ident” format, meaning they require a double dash prefix, similar to CSS custom properties (e.g., anchor-name: --button-1).

The “connected” piece usually a pseudo-element or a separate div acting as a highlighter becomes the target. By using position: absolute and position-anchor: --button-1, you tether the highlighter to that specific button. The magic happens when you update the position-anchor value on hover or focus. The browser perceives this as a layout change and can transition the position smoothly if you pair it with the right transition properties.

Beyond Simple Tooltips: The Power of Inset-Area

One of the most misunderstood aspects of this new API is how we define where the connected element sits. In the past, we relied on top, left, and complex calc() functions. The modern approach uses inset-area (often referred to as position-area in evolving specifications).

Imagine a 3×3 grid centered on your anchor button. inset-area allows you to place the connected element in any of these nine regions or spans of regions using intuitive keywords like top, bottom left, or span-all. When Ania demonstrates connecting buttons, she is leveraging this grid to ensure the highlighter perfectly aligns with the padding and margins of the trigger element without a single line of coordinate math.

The Performance Trade-off: Main Thread vs. Layout Engine

The industry is currently obsessed with “Core Web Vitals,” and for good reason. Every kilobyte of JavaScript used for positioning is a kilobyte that blocks the main thread. By moving the “connected” logic to the CSS Anchor Positioning API, we see a massive reduction in CPU usage. In some stress tests, switching from JS-based positioning to native CSS anchoring reduced CPU activity during scroll and resize events from 50% to under 5%.

The reason is simple: when the browser’s layout engine handles the positioning, it doesn’t have to wait for the JavaScript execution loop. It knows exactly where the anchor is during the layout phase and can place the target accordingly. This eliminates the “jitter” or lag often seen in JS tooltips where the box trails slightly behind the button during a fast scroll.

Interoperability and the “Bleeding Edge” Reality

While the technical advantages are clear, we have to address the elephant in the room: browser support. As of late 2024 and moving into 2026, we are seeing Chrome and Edge lead the charge with full support from version 125 onwards. Firefox and Safari have been slower to implement the full spec, particularly the more advanced @position-try rules which allow for smart fallbacks (e.g., “if there is no room on the top, move the tooltip to the bottom”).

For production-ready apps, this means we cannot fully delete our JavaScript fallbacks just yet. However, we can use “Progressive Enhancement.” We can ship the CSS-native version for modern browsers and keep a lightweight polyfill or basic absolute positioning for legacy ones.

Critical Perspective: Is It Over-Engineered?

Some skeptics argue that anchor-name adds unnecessary complexity to our stylesheets. Why give every button a name when we could just use a container? The answer lies in the Top Layer.

Modern web UIs often use the popover attribute or the <dialog> element. These elements live in a “top layer” that sits above all other z-index stacks. Historically, positioning a top-layer popover relative to a button in the deep DOM was a nightmare. Anchor Positioning is the only native CSS solution that can bridge this gap, allowing a top-layer element to “know” the coordinates of an element buried deep inside a flexbox or grid.

The Future of Design Systems

This shift will fundamentally change how we build component libraries like Shadcn/UI or Radix. Instead of shipping massive logic for “Edge Detection” and “Collision Handling,” these libraries will eventually become thin wrappers around @position-try and inset-area.

We are moving toward a declarative UI where we describe the intent of the connection (“stay next to this button”) rather than the mechanics (“calculate x + width + offset”). Ania’s tutorial on “Connected Buttons” is more than a styling trick; it is a preview of a world where JavaScript is no longer the glue that holds our layouts together.

Terbaru

  • The Death of Popper.js: Why CSS Anchor Positioning is the New Standard for Connected UI
  • Why Your 2027 Cloud Career Depends on Moving Beyond Basic AWS Services
  • Why Discord is Ditching Electron for Rust: Is GPUi Actually the Future?
  • The End of the KDE Era: Why KaOS 2026.11 Is a Bold, Dangerous Gamble
  • The $2 Billion Code: Why GTA 6 is a Technical Miracle and a Hardware Nightmare
  • LibreDB Studio Explained
  • PHP 8.6 Is Officially Out: What’s New, What Breaks, and How We’re Upgrading
  • Rewriting Legacy Apps: 4 Data Migration Strategies That Actually Work
  • How to Install Clean Windows 11 Without Any Bloatware (Step-by-Step Guide)
  • IP Address Rate Limiting is Flawed—Here is the Right Way to Do It
  • Are Fedora 45 Stuck in Its Comfort Zone? A Short Review
  • Hacktober Recap 2026, A Month Full of Dangerous CVE: eMudhra, Gitlab, Brotli, PHP, NodeJS etc
  • 7 Skill Keamanan Jaringan yang Membuat Network Engineer Makin Dibutuhkan
  • How to Spin Up Disposable macOS and Linux VMs on Apple Silicon with TartVM
  • Belajar Cyber Security dari Nol hingga Siap Kerja, Ini Roadmap Lengkapnya
  • Running Windows 11 on Apple Silicon: UTM vs. Parallels Desktop vs. VMware Fusion
  • Testing PikaOS, a Rolling Debian Distribution Special for Gaming and Content Creation
  • Engineering the On-Premises AI Data Center: An In-Depth Technical Review of the HP ZGX Fury AI Station
  • Trying my new Favourite Task Manager, TMOG on Omarchy Linux
  • ASRock Industrial AI Box A395: Is This the Best Compact Strix Halo System for Local AI?
  • Redox OS: A Rust-Based Microkernel Operating System (And How It Differs from Linux)
  • Canonical Is Bringing Back Ubuntu Core Desktop — This Time With a Clearer Plan
  • systemd Officially Adds Support for Rust Components
  • Rocky Linux Creator Builds a Brand-New “Not Linux” Kernel in 11 Days Using AI
  • Building a local AI agent in Workshop on Ubuntu 26.10
  • Omarchy 4.5 RC: 5 New Apps That Actually Look Useful
  • Worth It! Switching from Fedora KDE to Kubuntu
  • I’m Happy Using ‘Herdr’, The Fastest Growing Devtool written in Rust
  • Testing Goose on Omarchy Linux (App & CLI): The Open-Source Solution for Daily Task Automation
  • GNOME Founder Attacks Omarchy Founder as “Lazy, Racist, Ignorant”
  • Canonical: Ubuntu coming soon to Snapdragon X2 Series platforms
  • Finally, wolfSSL adds post-quantum algorithms!
  • How to Run Gemma Embedding Models Using Docker
  • Deploy Nginx Rootful Container with Podman
  • How to Sandboxing Browser on Linux Desktop with Flatpak
  • Why 32-Bit Precision is Overkill and How Quantization Rescues Edge AI
  • Building an Autonomous Event Planning Agent with Google Gemini (No Code Required!)
  • Qwen 4 Max, Is it A Really New Frontier Model in 2026?
  • OpenCode Browse Explained: Automate Any Website WITHOUT APIs
  • Leaked Qwen 4 and GLM 5.5 Post-Training, Beating the 27B Models
  • Lagi rame dicariin, kode redeem Reza Auditore November 2026 itu beneran ada atau cuma bercandaan doang?
  • Siapa Ary Bastari? Sosok Baru Bos Bayan Resources Gantikan Low Tuck Kwong, Ada Hubungan Sama Haji Isam?
  • Lagi rame dicari pemain Roblox, beneran ada mod motor 500cc buat Drag Drive Simulator?
  • Kabar Kurnia Tri Royani meninggal dunia itu beneran atau cuma hoax? Cek faktanya di sini
  • Lagi rame dicari, ini info soal livery Drag Bike 201m Sunmori buat Ninja SS sampai PCX 160

©2026 emka.web.id | Design: Newspaperly WordPress Theme