PACKAGE · UI COMPONENTS

@headlessui/react

A set of completely unstyled, fully accessible UI components for React, designed to integrate beautifully with Tailwind CSS.

WEEKLY DOWNLOADS 3.1M
STARS 28.6K
FORKS 1.2K
OPEN ISSUES 101
GZIP SIZE 60.9 kB
UNPACKED SIZE 1.0 MB
DEPENDENCIES 5
LAST UPDATED 5mo ago
DOWNLOAD TRENDS

@headlessui/react downloads — last 12 months

Download trends for @headlessui/react1 download series from Jun 2025 to May 2026. Use left and right arrow keys to inspect monthly values.06.4M12.8M19.2M25.6MJun 2025SepDecMarMay 2026
@headlessui/react
ABOUT @HEADLESSUI/REACT

Headless UI React provides a suite of completely unstyled, fully accessible UI components for React applications. It addresses the common challenge of building complex UI elements like modals, dropdowns, and toggles that are both semantically correct, keyboard-navigable, and screen-reader friendly. By separating presentation from behavior, it allows developers to integrate sophisticated UI logic without being constrained by pre-defined styling.

The core philosophy of Headless UI React is to offer robust, accessible foundations that developers can style entirely according to their project's design system. This approach is particularly beneficial for teams using CSS-in-JS solutions or utility-first CSS frameworks like Tailwind CSS, as it provides complete control over the visual output. The primary audience includes React developers prioritizing accessibility and custom design without wanting to reinvent complex UI patterns from scratch.

Key API patterns revolve around a hook-based and component-based approach. For instance, the `useDisclosure` hook manages the open/closed state for elements like modals or popovers, providing state and event handlers. Components like `<Listbox />`, `<Switch />`, and `<Dialog />` expose props that map directly to ARIA attributes and keyboard event handling, abstracting away much of the complexity inherent in building accessible interactive elements.

Integration is seamless within the React ecosystem, especially when paired with Tailwind CSS due to its explicit design goals. It naturally fits into workflows that require deep customization of UI appearance. The unstyled nature means it doesn't introduce its own opinions on theming or styling, making it adaptable to virtually any design system implementation within a React project.

With a bundle size of 68.4 kB (gzipped), Headless UI React offers a reasonable trade-off for the accessibility and complexity it abstracts. Its maturity is reflected in its significant adoption, indicated by 28.5K GitHub stars and 4.7M weekly downloads. The package is actively maintained, with recent updates contributing to its stability and feature set, though developers should note the last update date provided (2026-04-07) which might indicate a future-looking context or an error in the provided data.

Potential limitations include the absolute requirement for developers to provide all styling. This is by design, but it means that quick, unstyled prototypes are not the direct output. Integrating with existing component libraries that already include styling might require more effort to override or replace existing styles. The package also focuses on common UI primitives, so highly specialized or novel UI interactions might still necessitate custom solutions beyond the provided components.

WHEN TO USE
  • When building modals, dialogs, or overlays that require full keyboard navigation and ARIA attribute management.
  • When integrating custom-designed user interfaces with Tailwind CSS for a utility-first styling approach.
  • When prioritizing WCAG compliance and screen reader support for interactive UI elements like dropdowns and toggles.
  • When aiming to abstract complex UI state management (e.g., open/closed states, focus management) using hooks like `useDisclosure`.
  • When developing design systems where consistent, accessible UI patterns need to be applied across a React application without pre-packaged visual styles.
  • When needing to implement accessible form elements such as select lists (`<Listbox />`) or switches (`<Switch />`) that adhere to web accessibility standards.
WHEN NOT TO USE
  • If you only need basic state management for simple UI elements, React's built-in `useState` and `useContext` hooks may suffice.
  • If you require components with pre-built styling and theming out-of-the-box, a styled component library might be more direct.
  • When building a project where custom styling is a secondary concern and off-the-shelf components are preferred for speed.
  • If your project relies on a specific, opinionated UI framework that already includes its own set of accessible components.
  • For implementing purely presentational components that do not involve complex interactivity or state management requiring ARIA attributes.

CORRECTIONS

Spot wrong data here?

A short note helps us fix it.

Anonymous · No account · No email back

COMPARISONS 9
@headlessui/react vs @chakra-ui/react ★ 40.4K · 761.4K/wk @headlessui/react vs @mui/material ★ 98.4K · 4.4M/wk @headlessui/react vs @ark-ui/react ★ 5.2K · 419.0K/wk @headlessui/react vs @floating-ui/react ★ 32.6K · 8.5M/wk @headlessui/react vs @mantine/core ★ 31.2K · 983.0K/wk @headlessui/react vs @radix-ui/themes ★ 8.4K · 305.9K/wk @headlessui/react vs @ariakit/react ★ 8.6K · 399.0K/wk @headlessui/react vs antd ★ 98.3K · 1.5M/wk @headlessui/react vs @radix-ui/react-dialog ★ 18.9K · 28.9M/wk