@adobe/react-spectrum

中文文档
3.47.7发布于 2026/10/10Apache-2.0TypeScriptESM + CJS近 30 天下载 627.6万

Spectrum UI components in React

原始使用文档
文档目录4 节
  1. Features
  2. Getting started
  3. Example
  4. Learn more

React Spectrum

A React implementation of Spectrum, Adobe’s design system.

Features

  • ♿️ Accessible – React Spectrum components are designed with accessibility top-of-mind and include full screen reader and keyboard navigation support.
  • 📱 Adaptive – React Spectrum components are designed to work with mouse, touch, and keyboard interactions. They’re built with responsive design principles to deliver a great experience, no matter the device.
  • 🌍 International – React Spectrum components are designed to support over 30 languages, including support for right-to-left languages, date and number formatting, and more.
  • 🎨 Customizable theming – React Spectrum supports custom themes to match your brand, including automatic support for dark mode.

Getting started

The easiest way to start building a React Spectrum application is by following our getting started guide. It walks through all of the steps needed to install the components from npm, set up build tooling, and create your first application.

Example

Here is a very basic example of using React Spectrum.

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

// Render it in your app!
function App() {
  return (
    <Provider theme={theme}>
      <Button
        variant="cta"
        onPress={() => alert('Hey there!')}>
        Hello React Spectrum!
      </Button>
    </Provider>
  );
}

Learn more

React Spectrum is part of a family of libraries that help you build adaptive, accessible, and robust user experiences. Learn more about React Aria and React Stately if you'd like to build your own component library from scratch on our website.

版本与发布记录

@adobe/react-spectrum 共发布 1,372 个版本,首次发布于 2020/07/08;过去 12 个月发布了 223 个版本。

版本发布日期距今
3.47.7latest2026/10/1028 天前
3.0.0-nightly-2691598d3-261008nightly2026/10/0830 天前
3.47.62026/10/0830 天前
3.0.0-nightly-d3b2bd2fc-2610072026/10/071 个月前
3.0.0-nightly-99e610236-2610062026/10/061 个月前
3.0.0-nightly-99e610236-2610052026/10/051 个月前

关于 @adobe/react-spectrum 的常见问题

@adobe/react-spectrum 是什么?

Spectrum UI components in React

如何安装 @adobe/react-spectrum?

在项目目录运行 npm install @adobe/react-spectrum,或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖:react(^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1)、react-dom(^16.8.0 || ^17.0.0-rc.1 || ^18.0.0 || ^19.0.0-rc.1)。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖,Yarn 需要手动安装。

@adobe/react-spectrum 支持 TypeScript 吗?

支持。包内自带 TypeScript 类型声明(package.json 声明了 types 入口),安装后即可获得类型提示,无需再安装 @types 包。

@adobe/react-spectrum 支持 ESM 还是 CommonJS?

同时提供 ES Module 与 CommonJS 入口,import 和 require() 都可以使用,打包工具会自动选择合适的版本。

@adobe/react-spectrum 可以商用吗?

@adobe/react-spectrum 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@adobe/react-spectrum 的下载量有多少?

根据 npm 官方下载统计,@adobe/react-spectrum 在 2026/10/05 – 2026/11/03 这 30 天内被下载 6,275,639 次,日均约 209,188 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入,适合横向比较热度,不能直接等同于使用人数。

@adobe/react-spectrum 还在维护吗?

最新版本 3.47.7 发布于 2026/10/10(28 天前);至今共发布 1372 个版本,其中过去 12 个月发布了 223 个;首次发布于 2020/07/08。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。