Skip to content

Components

Component primitives handle the tricky parts of UI development—positioning, accessibility, keyboard navigation—so you can focus on design and business logic. This collection focuses on headless and low-level libraries that give you control.


The hardest part of building tooltips, dropdowns, and popovers is getting them to stay in the right place. These libraries solve the math.

Floating UI is the successor to Popper.js, rebuilt from scratch with a modular architecture.

import { computePosition, flip, shift, offset } from '@floating-ui/dom';
computePosition(referenceEl, floatingEl, {
placement: 'top',
middleware: [offset(8), flip(), shift()],
}).then(({ x, y }) => {
Object.assign(floatingEl.style, {
left: `${x}px`,
top: `${y}px`,
});
});
PackageSizeUse Case
@floating-ui/dom3kbVanilla JS
@floating-ui/react5kbReact with hooks
@floating-ui/vue4kbVue 3 composition API

Features:

  • Middleware system — Compose behaviors like flip, shift, arrow, size
  • Virtual elements — Position relative to cursor, selection, or arbitrary coordinates
  • Platform adapters — Works in DOM, React Native, Canvas

Popper.js — The original positioning library. Still widely used, but Floating UI is the recommended path forward.

Migration: Floating UI provides a migration guide for Popper.js users.


This section is intentionally minimal. For complete component systems, see:

  • Design Systems — Full component libraries with design tokens
  • Figma to Code — Libraries that ship both React components and Figma kits

NeedSolution
Just positioningFloating UI
Headless componentsRadix, Headless UI, React Aria
Full design systemChakra, Mantine, shadcn/ui
Native mobileReact Native Paper, Tamagui