React Stately is a JavaScript/TypeScript library developed by Adobe, providing highly accessible and robust state management hooks for complex UI components within the React ecosystem. It is a foundational part of the Adobe React Spectrum and React Aria libraries, focusing on managing component behavior and data without dictating visual presentation. This "headless" approach allows developers to build custom UIs while leveraging battle-tested accessibility and interaction patterns. As of April 2026, the current stable version is 3.46.0. The library follows a frequent release cadence, often with monthly or bi-monthly updates, reflecting ongoing feature development and improvements, especially in coordination with React Aria Components and React Spectrum S2. Its key differentiators include a strong emphasis on WAI-ARIA standards compliance, complex collection management (lists, grids, trees), and sophisticated interaction handling, making it suitable for enterprise-grade applications requiring high accessibility and performance.
npm install react-statelyVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to use `useListState` to manage selection state for a list of items, including toggling selection and programmatic state manipulation.
Consider pairing `react-stately` with `react-aria` for full accessibility and interaction logic, or `@react-spectrum/s2` for pre-built components.
Ensure `getKey` prop is correctly implemented for all items to provide stable, unique keys. Thoroughly test dynamic collection updates and nested structures.
Always explicitly define the generic type parameter for hooks like `useListState`, `useSelectState`, etc., based on the shape of your data items.
Always use ES module `import` syntax (e.g., `import { useListState } from 'react-stately';`). Ensure your build setup correctly processes ES modules.Ensure `useListState` or other `react-stately` hooks are called at the top level of your functional component, not inside loops, conditions, or nested functions.
Verify that the `items` array passed to `useListState` is correctly formatted and not `null` or `undefined`. Ensure `getKey` is also provided if items don't have a default `id` or `key` property.
Provide a stable and unique `getKey` function in the `useListState` (or similar hook) options, or explicitly set a `key` prop on your rendered elements using `item.key` or a truly unique identifier from `item.value`.
Define the generic type for the hook, e.g., `const state = useListState<MyItemType>({ items: ..., ... });`. This ensures `item.value` is correctly typed as `MyItemType`.