Downshift is a set of React primitives designed to build highly accessible and flexible autocomplete, combobox, and select dropdown components. It provides stateful logic and ARIA-compliant attributes without dictating UI. The library currently ships with version 9.3.2 and maintains an active release cadence, with bug fixes and minor features released frequently. Key differentiators include its focus on WAI-ARIA compliance, offering both modern React Hooks (like `useCombobox`, `useSelect`, and `useTagGroup`) and a legacy render prop component (`Downshift`). The hooks are the recommended approach as they support the latest ARIA 1.2 combobox patterns, offering superior accessibility compared to the older `Downshift` component which is slated for eventual removal. Downshift prioritizes developer freedom by providing only the necessary logic, allowing users to fully customize the visual presentation.
npm install downshiftVerified import paths — ran on the pinned version, not inferred.
This example demonstrates how to create an accessible combobox component using the `useCombobox` hook, including filtering and selection logic.
Migrate your components to use `useCombobox` or `useSelect`. Refer to the official migration guide for v7 and specific hook documentation.
Review the v7 migration guide on the official Downshift website. Many props and return values from the hooks were updated or renamed.
Plan to implement all CSS/styling yourself. The library offers no built-in styles.
Ensure your bundler (e.g., Webpack, Rollup) is configured to correctly resolve `package.json` 'exports' field and handle both CJS and ESM modules. Most modern setups should work out-of-the-box.
Ensure `items` is a stable reference or memoized if it's derived from state. Update `items` efficiently using `onInputValueChange` or similar callbacks to control filtering logic.
Ensure you are using `import { useCombobox } from 'downshift';` in an ESM-compatible environment. If using a CommonJS file, ensure your build setup correctly transpiles or resolves ESM imports. Check bundler configuration for module resolution.Verify that `import { Downshift } from 'downshift';` is correct if you are still using the render prop component, or ensure you are calling the `useCombobox`/`useSelect` hooks within a functional React component, not rendering the hook itself.Memoize your `items` array using `React.useMemo` if it's derived from other state or props, or ensure it's defined outside the component render function if it's static data.