react-spectrum-s2
React Spectrum S2 (Spectrum 2)
If the requirements do not clearly specify which React Spectrum component to use, consult the Component Decision Tree before choosing a component.
If the request involves a Figma design, frame, or URL — or if the Figma MCP (get_design_context,search_design_system, etc.) is available — consult Implementing Figma designs with React Spectrum S2 before generating code.
When writing tests that exercise S2 components, consult Testing with React Spectrum S2 and prefer the ARIA pattern testers from @react-spectrum/test-utils over hand-rolled role/selector queries.
React Spectrum S2 vs React Aria Components
React Spectrum S2 is built on top of React Aria Components. The S2 components add Spectrum 2 styling, behavior, and slot structure on top of the unstyled React Aria primitives. Always prefer S2 components for React Spectrum work because they are pre-styled, design-system compliant, and cover most common UI patterns.
Only reach for React Aria Components directly when:
- Building a custom component because no S2 component matches the requirements. Follow Creating Custom Components and pair the React Aria primitive with the S2
stylemacro for Spectrum styling. - You need a utility such as
FocusScope,VisuallyHidden,useFocusRing,mergeProps, etc.
The React Aria Components documentation is bundled under references/react-aria/. Many unstyled React Aria Components share the same name as S2 components, so ensure that you're searching and accessing the correct docs where needed.