How tailwindlabs/headlessui works
Headless UI is a set of unstyled, accessible component libraries for React and Vue, with a companion Tailwind CSS package. The principal workflow is a consumer composing library components into an interface, where component state, interaction handling, and rendering provide accessible UI behavior. The tree shows broad component families; sampled React and Vue comboboxes illustrate the interaction layer, while React excerpts show shared rendering and positioning helpers. Most other component internals were not sampled, so their detailed call relationships are omitted.
Main entry points: combobox.tsx React Combobox · floating.tsx Floating Positioning · use-outside-click.ts Outside Click · use-event.ts Stable Event Hook
Components 18
Public UI APIs
- React Package
packages/@headlessui-react/src/index.ts - Vue Package
packages/@headlessui-vue/src/index.ts
Interactive Components
- React Controls
packages/@headlessui-react/src/components - Vue Controls
packages/@headlessui-vue/src/components - React Combobox
packages/@headlessui-react/src/components/combobox/combobox.tsx - Vue Combobox
packages/@headlessui-vue/src/components/combobox/combobox.ts - React Dialog
packages/@headlessui-react/src/components/dialog/dialog.tsx - Vue Dialog
packages/@headlessui-vue/src/components/dialog/dialog.ts - React Transitions
packages/@headlessui-react/src/components/transition/transition.tsx - Vue Transitions
packages/@headlessui-vue/src/components/transitions/transition.ts
Runtime Foundations
- React Renderer
packages/@headlessui-react/src/utils/render.ts - Floating Positioning
packages/@headlessui-react/src/internal/floating.tsx - Outside Click
packages/@headlessui-react/src/hooks/use-outside-click.ts - Focus Utilities
packages/@headlessui-react/src/utils/focus-management.ts - Stable Event Hook
packages/@headlessui-react/src/hooks/use-event.ts - Latest Value Hook
packages/@headlessui-react/src/hooks/use-latest-value.ts
Tailwind Integration
- Tailwind CSS Package
packages/@headlessui-tailwindcss/src/index.ts
Other components
- Application Developer
Connections 10
- Application Developer → React Package: installs
README.md - Application Developer → Vue Package: installs
README.md - Application Developer → Tailwind CSS Package: uses
- React Combobox → Outside Click: calls
packages/@headlessui-react/src/components/combobox/combobox.tsx - React Combobox → Floating Positioning: provides positioning
packages/@headlessui-react/src/components/combobox/combobox.tsx - React Combobox → React Renderer: uses renderer
packages/@headlessui-react/src/components/combobox/combobox.tsx - Vue Combobox → Vue Controls: renders components
packages/@headlessui-vue/src/components/combobox/combobox.ts - Outside Click → Focus Utilities: checks focus
packages/@headlessui-react/src/hooks/use-outside-click.ts - Stable Event Hook → Latest Value Hook: reads callback
packages/@headlessui-react/src/hooks/use-event.ts - Floating Positioning → Stable Event Hook: uses hook
packages/@headlessui-react/src/internal/floating.tsx