# @algolia/satellite 中文文档

规范地址：https://npmcn.com/package/%40algolia/satellite/

版本：2\.15\.0
npm 元数据更新时间：2026-11-03T20:54:21.830Z
中文译文更新时间：2026-11-06T08:42:20.099Z
软件包许可：MIT

本文由上游 README 翻译，可能存在偏差，请结合原文核对 API、命令与配置。版权与许可归原作者所有。

原始 npm 页面：https://www.npmjs.com/package/%40algolia/satellite
原文对照：https://npmcn.com/package/%40algolia/satellite/?lang=original
项目主页：https://satellite.algolia.com/
源码仓库：https://github.com/algolia/satellite

## 关键信息（来自 npm 元数据）

- 包体积（解压后）：3.1 MB，1555 个文件
- 模块格式：ESM + CJS
- TypeScript 类型：包内自带
- Node.js 要求：\>=20\.19\.0 \|\| \>=22\.12\.0
- 运行依赖：38 个
- peer 依赖：react ^17\.0\.0，react-dom ^17\.0\.0，react-instantsearch-dom ^6\.1\.0，react-syntax-highlighter ^15\.6\.1
- 首次发布：2019-04-23T11:54:20.591Z
- 最新版本发布：2026-10-20T14:29:52.509Z
- 近 30 天下载量：3755（2026-10-06 至 2026-11-04，npm 官方下载统计）
- 已发布版本数：360（近 12 个月 14 个）

## 中文简介

Algolia 设计系统

## 安装

```sh
npm install @algolia/satellite
```

也可以使用：`pnpm add @algolia/satellite`、`yarn add @algolia/satellite`、`bun add @algolia/satellite`

## README

# 卫星

![Nothing to see here](https://algolia-satellite.s3-eu-west-1.amazonaws.com/nothing-to-see-here.gif)

[图书馆文件](https://satellite.algolia.com/) | [国家预防机制](https://www.npmjs.com/package/@algolia/satellite) | [故事书](https://satellite-storybook.algolia.com/) | [图片](https://www.figma.com/file/99l59il97k2n5y4n6Jucal/%5BSatellite%5D-Components)

## 安装

```sh
yarn add @algolia/satellite
```

## 快开始

```js
import React from "react";
import ReactDOM from "react-dom";

import "@algolia/satellite/satellite.min.css";

import { Satellite, Button } from "@algolia/satellite";

const App = () => (
  <Satellite>
    <Button>Hurray!</Button>
  </Satellite>
);

ReactDOM.render(<App />, document.getElementById("root"));
```

## 使用量

### 将其纳入现有项目

您可以导入 `@algolia/satellite/satellite.min.css` 在你剩下的风格之前 它包含了一个稍作修改的版本 `normalize.css` 以及图书馆组件的样式.

如果您使用 scs 并想要重用颜色来构建自定义组件, 则可以在 `@algolia/satellite/styles/scss/colors.scss`。 。 。 .

如果您使用某种形式的cs-in-js库并想要再利用颜色来构建自定义组件,则可以在 `@algolia/satellite/styles/scss/colors.scss`

### 我想建立一个快速的原型

您可以导入 `@algolia/satellite/satellite.css` 在你剩下的风格之前 它包含了由库尾风配置所生成的所有课程,未被净化. 课程前缀为 `stl-`建议使用 `stl` 标签模板函数可用于 `@algolia/satellite;`

请参考正式文件,看有哪些课程 [https://tailwindcs.com/ 页面存档备份,存于互联网档案馆](https://tailwindcss.com/)

```jsx
import React from "react";
import ReactDOM from "react-dom";

import "@algolia/satellite/satellite.min.css";

import { Satellite, Button, stl } from "@algolia/satellite";

const loading = true;

const App = () => (
  <Satellite>
    <div
      className={stl`
        flex flex-col m-4
        ${loading && "hidden"}
      `}
    >
      <Button className={stl`mb-2`}>Clap your hands!</Button>
      <Button>Hurray!</Button>
    </div>
  </Satellite>
);

ReactDOM.render(<App />, document.getElementById("root"));
```

### 我想直接用尾风

首先安装尾风

```sh
yarn add -D tailwindcss
```

示例 `main.css`

```css
@tailwind base;
@tailwind components;
@tailwind utilities;

@layer components {
  /* your custom components */
}
```

示例 `postcss.config.js`

```js
// ...

const plugins = [
  require("postcss-import"),
  require("tailwindcss")(tailwindConfig),
  require("autoprefixer"),
  cssnano({ preset: "default" }),
];

module.exports = { plugins };
```

示例 `tailwind.config.js`

```js
const { makePurgeCssExtractor } = require('@algolia/satellite');
const satelliteConfig = require("@algolia/satellite/cjs/styles/tailwind.config.js");

module.exports = {
  presets: [satelliteConfig],
  content: [
    files: [
      `node_modules/@algolia/satellite/**/*.js`,
      `node_modules/react-day-picker/lib/style.css`,
      `node_modules/react-day-picker/src/**/*.js`,

      `src/**/*.{ts,tsx,js,jsx}`,
      // Any other sources files
    ],
    extract: makePurgeCssExtractor(prefix),
  ],
  theme: {
    extend: {
      // any colors, fonts... you want to add
    }
  },
  plugins: [
    // extra plugins you want to add
  ]
};
```

示例 `index.jsx`

```jsx
import React from "react";
import ReactDOM from "react-dom";

import "./main.css";

import { Satellite, Button, stl } from "@algolia/satellite";

const loading = true;

const App = () => (
  <Satellite>
    <div
      className={stl`
        flex items-center justify-center
        ${loading && "hidden"}
      `}
    >
      <Button>Hurray!</Button>
    </div>
  </Satellite>
);

ReactDOM.render(<App />, document.getElementById("root"));
```

## 常见问题

### @algolia/satellite 是什么？

Algolia 设计系统

### 如何安装 @algolia/satellite？

在项目目录运行 npm install @algolia/satellite，或使用 pnpm add / yarn add / bun add。它还需要宿主项目提供 peer 依赖：react（^17\.0\.0）、react-dom（^17\.0\.0）。npm 7 及以上与 pnpm 8 及以上默认会自动安装必需的 peer 依赖，Yarn 需要手动安装。

### @algolia/satellite 支持 TypeScript 吗？

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

### @algolia/satellite 支持 ESM 还是 CommonJS？

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

### @algolia/satellite 需要什么版本的 Node\.js？

package\.json 的 engines 字段要求 Node\.js \>=20\.19\.0 \|\| \>=22\.12\.0。版本不符时 npm 默认只给出警告，开启 engine-strict 后会拒绝安装。

### @algolia/satellite 可以商用吗？

@algolia/satellite 使用 MIT 许可。宽松许可：允许商业使用、修改和再分发，通常只需在分发时保留原版权与许可声明。以上为概括，不构成法律意见，请以许可原文为准。

### @algolia/satellite 的下载量有多少？

根据 npm 官方下载统计，@algolia/satellite 在 2026/10/06 – 2026/11/04 这 30 天内被下载 3,755 次，日均约 125 次。下载量会把 CI 构建、镜像同步和作为其他包依赖的安装一并计入，适合横向比较热度，不能直接等同于使用人数。

### @algolia/satellite 还在维护吗？

最新版本 2\.15\.0 发布于 2026/10/20（16 天前）；至今共发布 360 个版本，其中过去 12 个月发布了 14 个；首次发布于 2019/04/23。发布频率只是参考信号：功能稳定的工具可能很少需要更新，建议结合源码仓库的 issue 和提交记录判断。

