
Security News
Risky Biz Podcast: AI Agents Are Raising the Stakes for Software Supply Chain Security
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.
react-stately
Advanced tools
A library of React Hooks that provides cross-platform state management for your design system.
The easiest way to start building a component library with React Stately is by following our getting started guide. It walks through all of the steps needed to install the hooks from npm, and create your first component.
Here is a very basic example of using React Aria.
import {useRadioGroupState} from '@react-stately/radio';
function RadioGroup(props) {
let state = useRadioGroupState(props);
return (
<>
<label>
<input
type="radio"
name={state.name}
checked={state.selectedValue === 'dogs'}
onChange={() => state.setSelectedValue('dogs')}
/>
Dogs
</label>
<label>
<input
type="radio"
name={state.name}
checked={state.selectedValue === 'cats'}
onChange={() => state.setSelectedValue('cats')}
/>
Cats
</label>
</>
);
}
<RadioGroup
defaultValue="dogs"
onChange={(value) => alert(`Selected ${value}`)}
/>
React Stately is part of a family of libraries that help you build adaptive, accessible, and robust user experiences. Learn more about React Spectrum and React Aria on our website.
react-use is a collection of essential React hooks that cover a wide range of use cases, from state management to side effects. It provides hooks like useList, useToggle, and useInput, which offer similar functionalities to react-stately's useListState, useToggleState, and useComboBoxState, respectively. However, react-use is more general-purpose and not specifically focused on accessibility.
zustand is a small, fast, and scalable state management library for React. It provides a simple API for managing global state and can be used to create custom hooks for specific state management needs. While zustand is not specifically designed for accessibility, it offers a flexible and performant alternative to react-stately for managing component state.
react-spring is a spring-physics-based animation library for React applications. It provides hooks for managing animated states, which can be used to create interactive and dynamic user interfaces. While react-spring is primarily focused on animations, it can complement react-stately by providing animated state transitions for components.
FAQs
Spectrum UI components in React
The npm package react-stately receives a total of 5,204,201 weekly downloads. As such, react-stately popularity was classified as popular.
We found that react-stately demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 2 open source maintainers collaborating on the project.
Did you know?

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Security News
Open source attacks are accelerating as AI coding agents pull in dependencies faster, with less human review.

Research
/Security News
Malicious Chrome and Firefox extensions posed as free VPNs while stealing clipboard data through later extension updates.

Research
/Security News
Miasma Mini Shai-Hulud hits @immobiliarelabs Backstage plugins, targeting GitLab and LDAP auth packages on npm.