Headless UI

Unstyled, fully accessible UI components for React and Vue, built for Tailwind CSS

Library
npm
v2.2.10
28,758 stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum. How we score it →
55 /100 Fair
Development Activity 8
Maintenance 48
Community 64
Maturity 60
Momentum 40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation. How we score it →
86 /100 Excellent
Architecture 88
Code Quality 84
Innovation 90
Learning Curve 75

Headless UI is a set of completely unstyled, fully accessible UI primitives from the Tailwind CSS team, built for React (with companion Vue and Tailwind plugin packages) and designed to integrate beautifully with Tailwind CSS. It ships fully working components — Menu, Dialog, Listbox, Combobox, Disclosure, and more — that implement correct ARIA attributes, keyboard navigation, and focus management out of the box, while leaving 100% of the visual styling to you.

Rather than wrapping opinionated markup in themeable props, Headless UI hands you render props and data attributes so every pixel is styled with your own Tailwind classes or any CSS approach. It is actively maintained by Tailwind Labs, versioned alongside Tailwind’s own ecosystem, and used by teams who want production-grade accessibility without inheriting a component library’s visual opinions.

What You Get

  • A full set of interactive primitives — Menu, Listbox, Combobox, Dialog, Disclosure, Popover, Tabs, Switch, RadioGroup, and more
  • WAI-ARIA compliant markup and keyboard interactions handled internally via a dedicated state-machine architecture
  • Render-prop and data-attribute APIs (data-headlessui-state) for styling active/selected/open states with any CSS approach
  • An official Vue port (@headlessui/vue) and a companion Tailwind CSS plugin (@headlessui/tailwindcss) for targeting component state in utility classes

Common Use Cases

  • Building custom dropdown menus, comboboxes, and autocomplete inputs without reimplementing keyboard navigation
  • Adding accessible modal dialogs and slide-over panels with correct focus trapping and scroll locking
  • Composing design-system components (tabs, switches, radio groups) that match a Tailwind-based visual language exactly

Under The Hood

Architecture Each component pattern (Dialog, Menu, Listbox, Combobox, …) is backed by a dedicated state machine defined against an abstract Machine<State, Event> base class (src/machine.ts) that manages state via private class fields and a subscriber/selector model, with additional shared machines (e.g. a stack machine for nested dialogs) under src/machines/. A thin React binding layer (src/react-glue.tsx, useSlice) subscribes components to just the state slices they need, keeping re-renders minimal, while src/components/* wires the machine output to DOM elements through shared hooks (use-outside-click, use-escape, use-focus-trap, etc.). This separation of framework-agnostic state logic from framework bindings is also what lets the monorepo maintain parallel React and Vue implementations from a similar internal model.

Tech Stack The library is TypeScript-first (95%+ of the codebase), with peer dependencies limited to react/react-dom (^18 || ^19). Runtime dependencies are narrow and purposeful: @floating-ui/react for popover/combobox positioning, @react-aria/focus and @react-aria/interactions for battle-tested accessibility primitives, @tanstack/react-virtual for virtualized rendering of large Combobox/Listbox option lists, and a use-sync-external-store shim for concurrent-safe external store subscriptions. Builds run through a custom esbuild-based scripts/build.sh that emits dual ESM/CJS bundles plus generated .d.ts/.d.cts typings, orchestrated across the packages/* and playgrounds/* npm workspaces.

Code Quality The @headlessui/react package alone carries roughly 30 Jest test files (via jest.config.cjs, @testing-library/react, jsdom-testing-mocks, and snapshot-diff) covering nearly every component directory — dialog, combobox, listbox, menu, disclosure, and more. Prettier is configured with prettier-plugin-organize-imports and prettier-plugin-tailwindcss, and a husky + lint-staged pre-commit hook runs lint on every commit, giving the codebase consistent formatting and import ordering. Encapsulation is taken seriously even in low-level code — the Machine base class uses native TypeScript private class fields (#state, #subscribers) rather than convention-based privacy.

API Design Consumers import one named component per pattern (<Dialog>, <Menu>, <Combobox>) that renders a sensible default element but supports full polymorphism via an as prop (forwardRefWithAs/useRender utilities), and every stateful sub-part exposes its open/active/selected condition through a data-headlessui-state attribute plus render-prop children — so styling state never requires manually threading booleans through props. Getting started requires no configuration beyond install-and-import, and the same compositional shape (Root → Button/Trigger → Panel/Items) repeats across every component, which flattens the learning curve considerably once the first pattern is learned.

Used by 51 apps in this directory

TypeScript
76%
AGPL 3.0

Abby

Developer Tools · Product Management

166

Statically typed feature flags, remote config, and A/B testing with framework-native SDKs for TypeScript teams.

View details
31
Repo Health
70
Technical
64
Dependency
Built with
TypeScript 76%
MDX 18%
Updated 1 years ago
Python
85%
MIT

ai-toolkit

AI Design Tools · AI Development

12,143

An all-in-one open-source training suite for finetuning diffusion models—FLUX, SDXL, Wan video, and audio—on consumer GPU hardware via CLI or web UI.

View details
79
Repo Health
66
Technical
72
Dependency
Built with
Python 85%
TypeScript 14%
Updated 5 days ago
Python
47%
Other

Airbyte

Data Engineering · Developer Tools

22,143

Open-source ELT platform with 600+ connectors for moving data from any source to warehouses, lakes, and AI agents.

View details
95
Repo Health
80
Technical
67
Dependency
Built with
Python 47%
Kotlin 43%
Updated 4 days ago
Python
62%
MIT

AutoGen

AI Development · Automation

61,194

Build autonomous and human-in-the-loop multi-agent AI systems with a layered, event-driven Python and .NET framework pioneered at Microsoft Research.

View details
56
Repo Health
78
Technical
73
Dependency
Built with
Python 62%
C# 25%
TypeScript 12%
Updated 5 months ago
PHP
63%
Other

BillaBear

Ecommerce · Invoicing Finance

761

Self-hostable subscription management and billing platform with Stripe integration, tax automation, configurable workflows, and Twig-based document generation.

View details
76
Repo Health
66
Technical
65
Dependency
Built with
PHP 63%
Vue 18%
Gherkin 13%
Updated 2 weeks ago
TypeScript
92%
GPL 3.0

Blinko

Knowledge Management · Note Taking

11,049

A self-hosted, AI-powered card note-taking tool that lets you capture fleeting thoughts instantly and retrieve them with natural language search.

View details
75
Repo Health
69
Technical
63
Dependency
Built with
TypeScript 92%
Updated 1 months ago
Rust
54%
Other

Cap

Team Chat · Video Conferencing

22,884

Open source Loom alternative with GPU-accelerated recording, instant share links, AI summaries, and full self-hosting via Docker Compose.

View details
89
Repo Health
81
Technical
64
Dependency
Built with
Rust 54%
TypeScript 42%
Updated 4 days ago
TypeScript
53%
Other

Chaskiq

CRM · Customer Support

3,574

Self-hosted live chat, video calls, help center, and marketing automation — a full-stack Intercom alternative you run on your own infrastructure.

View details
57
Repo Health
66
Technical
66
Dependency
Built with
TypeScript 53%
Ruby 36%
Updated 3 months ago
TypeScript
84%
Apache 2.0

Continue

AI Code Assistants · AI Development · Automation

36,049

Open-source coding agent for VS Code, JetBrains, and CLI with support for 30+ LLM providers.

View details
73
Repo Health
88
Technical
62
Dependency
Built with
TypeScript 84%
Updated 5 days ago

Join founders buildingwith open source

Opinionated takes, migration guides, cost-saving tips, and insights from the open source ecosystem.

Subscribe on Substack
Join 750+ subscribers