downshift

Accessible React hooks and a render-prop primitive for building fully custom autocomplete, combobox, select, and multi-select components.

Library
npm
v9.4.0
12,307stars
MIT License

Repository Health

Pre-computed score based on development activity, maintenance, community, maturity, and trend momentum.How we score it →
63/100Good
Development Activity32
Maintenance52
Community68
Maturity60
Momentum40

Technical Analysis

AI-assessed by reading the actual repository — architecture, code quality, innovation, and documentation.How we score it →
85/100Excellent
Architecture78
Code Quality88
Innovation82
Learning Curve90

Downshift provides the stateful logic behind autocomplete, combobox, select, and tag-group UI without dictating markup or styling. Rather than shipping pre-styled components, it exposes React hooks — useSelect, useCombobox, useTagGroup, and the legacy useMultipleSelection — plus the original Downshift render-prop component, each of which manages state transitions, keyboard navigation, and prop wiring so consuming code can render its own DOM structure.

The library was built to satisfy the WAI-ARIA authoring practices for combobox and listbox patterns, including the ARIA 1.2 combobox specification the hooks were migrated to in v7. It ships with TypeScript typings, Preact and React Native support, and a Docusaurus-based docs site with live examples, making it a common foundation for teams building fully custom dropdown-style inputs instead of depending on a pre-styled UI kit.

What You Get

  • useSelect, useCombobox, and useTagGroup hooks that manage open/closed state, highlighted index, keyboard navigation, and ARIA attribute wiring for custom dropdown components
  • The original Downshift render-prop component for teams not yet on the hook-based API, sharing the same accessible interaction model
  • Prop getters (getInputProps, getItemProps, getMenuProps, getToggleButtonProps, etc.) that attach the right event handlers and ARIA attributes without prescribing any markup
  • Full TypeScript typings, Preact interop, and a React Native build target alongside the standard web build
  • A stateReducer / reducer escape hatch for intercepting and overriding internal state transitions before they’re applied

Common Use Cases

  • Building a fully custom-styled autocomplete search input that still passes WAI-ARIA combobox audits
  • Implementing a multi-select or tag input where selected items render as removable chips
  • Replacing a native <select> with a custom-styled dropdown that needs keyboard and screen-reader parity with the native element
  • Powering design-system dropdown/combobox primitives that other teams compose into product-specific components

Under The Hood

Architecture The core Downshift component (src/downshift.js) implements a class-based state machine handling isOpen/highlightedIndex/inputValue/selectedItem, routed through a stateReducer hook and exposed via prop-getters (getInputProps, getItemProps, getMenuProps, getToggleButtonProps, getRootProps) that attach ARIA attributes and event handlers computed from internal state. The hooks package (src/hooks) reimplements the same primitives on top of React’s useReducer via a shared reducer.ts and useEnhancedReducer/useControlledReducer utilities in src/hooks/utils, with per-hook modules (useSelect, useCombobox, useTagGroup, legacy useMultipleSelection) each supplying their own reducer cases, prop getters, and stateChangeTypes, while cross-cutting concerns (control-prop validation via useControlPropsValidator, scroll-into-view via useScrollIntoView, id generation via useElementIds) live as composable hooks in src/hooks/utils. It’s a layered “core reducer + prop-getter” pattern replicated per widget rather than a single monolith, so changes to the shared reducer/useControlledReducer layer ripple into all four hooks, while adding a new widget mainly means composing the existing utils into a fresh hook.

Tech Stack Runtime dependencies are minimal — @babel/runtime, compute-scroll-into-view, prop-types, react-is, tslib — with react as the sole peer dependency. Build tooling is kcd-scripts driving Babel and Rollup to emit CJS, ESM, and React Native bundles alongside TypeScript declaration-only output for typings/index.d.ts. Docs are built with Docusaurus and deployed via Netlify. Testing runs on Jest for unit/integration coverage plus Playwright for browser-level e2e specs, and CI is a single GitHub Actions workflow (validate.yml) that runs lint, build-and-test, coverage, tsc —noEmit, an SSR check, and the e2e suite on every push.

Code Quality The repo carries extensive test coverage — more than seventy test files under src/**/tests exercising nearly every prop-getter and utility function individually, plus top-level integration tests and Playwright e2e specs driving real browser interaction. tsconfig.json enables strict, strictNullChecks, and noUncheckedIndexedAccess, and the codebase mixes TypeScript with a smaller amount of legacy untyped JavaScript (mainly around the older useMultipleSelection hook). Linting and formatting are centralized via kcd-scripts and enforced through a husky pre-commit hook plus lint-staged, and CI gates every push behind the full validate script.

API Design Downshift’s defining design choice is a fully “headless” API: every interactive element’s props (onClick, onKeyDown, id, role, aria-*) are computed by calling a getter function and spreading the result, so consumers own all markup and styling while still getting ARIA-1.2-compliant combobox/listbox behavior. This predates and directly inspired later headless-UI libraries, and the stateReducer/control-props duality gives two escalation paths — override a single state transition inline, or hand state ownership entirely to an external store — without needing two different APIs. There is a genuine ramp-up cost to internalizing the prop-getter convention, which the project’s own FAQ and migration guides acknowledge directly.

Used by 11 apps in this directory

TypeScript
94%
MIT

Actual

Invoicing Finance

28,593

Local-first personal finance with envelope budgeting, end-to-end encryption, and multi-device sync — no subscription required.

View details
93
Repo Health
85
Technical
77
Dependency
Built with
TypeScript94%
Updated today
Rust
86%
Other

Arroyo

Data Engineering · Analytics

5,029

A distributed stream processing engine written in Rust that lets you write SQL to run stateful, real-time computations over data streams with subsecond results.

View details
86
Repo Health
74
Technical
62
Dependency
Built with
Rust86%
Updated 3 days ago
TypeScript
96%
Other

Cal.diy

Scheduling

48,218

The 100% MIT-licensed, community-driven scheduling platform — self-host your own booking infrastructure with no enterprise strings attached.

View details
95
Repo Health
86
Technical
65
Dependency
Built with
TypeScript96%
Updated yesterday
JavaScript
90%
Other

CodeSandbox

Code Editors · Developer Tools

13,640

Instantly ready browser-based IDE that runs full npm dependency resolution and transpilation entirely client-side, with no server needed.

View details
69
Repo Health
76
Technical
62
Dependency
Built with
JavaScript90%
Updated 1 weeks ago
TypeScript
84%
Apache 2.0

Continue

Developer Tools · AI Development · AI Code Assistants

35,808

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

View details
81
Repo Health
88
Technical
62
Dependency
Built with
TypeScript84%
Updated yesterday
TypeScript
49%
AGPL 3.0

Grafana

Monitoring · Analytics

76,643

The open-source observability platform that unifies metrics, logs, and traces from any data source into dynamic, queryable dashboards.

View details
95
Repo Health
91
Technical
63
Dependency
Built with
TypeScript49%
Go45%
Updated today
TypeScript
94%
Other

OpenHands

AI Code Assistants · AI Development

86,377

The self-hosted developer control center for running AI coding agents — locally, in Docker, on VMs, or across cloud backends — with automation workflows for GitHub, Slack, and more.

View details
91
Repo Health
82
Technical
70
Dependency
Built with
TypeScript94%
Updated today
JavaScript
63%
AGPL 3.0

overleaf

Collaboration · Productivity

18,090

Open-source, real-time collaborative LaTeX editor with sandboxed compilation and full TeXLive support for self-hosted academic and research teams.

View details
82
Repo Health
80
Technical
62
Dependency
Built with
JavaScript63%
TypeScript29%
Updated 1 months ago
TypeScript
88%
MIT

Plasmic

CMS · Low Code Platforms · No Code Platforms

6,993

The open-source visual builder that lets teams design React apps and websites with drag-and-drop while integrating seamlessly with your codebase.

View details
81
Repo Health
78
Technical
64
Dependency
Built with
TypeScript88%
Updated yesterday

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

Search