Installation

# React Spectrum S2 (recommended for new projects)
npm install @react-spectrum/s2

# Peer dependencies
npm install react react-dom react-aria react-stately

Provider setup

Wrap your app in Provider to supply the theme and locale context to all Spectrum components.

import {Provider, defaultTheme} from '@react-spectrum/s2';

function App() {
  return (
    <Provider theme={defaultTheme} colorScheme="light">
      {/* your app here */}
    </Provider>
  );
}

Your first component

import {Button, TextField} from '@react-spectrum/s2';
import {useState} from 'react';

function SearchBar() {
  const [value, setValue] = useState('');

  return (
    <div style={{display: 'flex', gap: 8}}>
      <TextField
        label="Search"
        value={value}
        onChange={setValue}
        placeholder="Search…"
      />
      <Button
        variant="accent"
        onPress={() => console.log(value)}>
        Search
      </Button>
    </div>
  );
}

Ready to build?

Explore the full component library, design docs, and React Spectrum API references — and ask the AI assistant any question about Spectrum.

Adobe
Spectrum AI assistant

Hello, how can I help you today?

Ask anything about Adobe Spectrum — design tokens, React components, or accessibility.

Spectrum Design Docs React Spectrum S2 React Spectrum v3