@algolia/satellite

中文文档
2.15.0发布于 2026/10/20MITTypeScriptESM + CJS近 30 天下载 3755

Algolia 设计系统

中文使用文档
文档目录6 节
  1. 安装
  2. 快开始
  3. 使用量
  4. 将其纳入现有项目
  5. 我想建立一个快速的原型
  6. 我想直接用尾风

卫星

Nothing to see here

图书馆文件 | 国家预防机制 | 故事书 | 图片

安装

yarn add @algolia/satellite

快开始

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/ 页面存档备份,存于互联网档案馆

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"));

我想直接用尾风

首先安装尾风

yarn add -D tailwindcss

示例 main.css

@tailwind base;
@tailwind components;
@tailwind utilities;

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

示例 postcss.config.js

// ...

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

module.exports = { plugins };

示例 tailwind.config.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

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 共发布 360 个版本,首次发布于 2019/04/23;过去 12 个月发布了 14 个版本。

版本发布日期距今
2.15.0latest2026/10/2016 天前
2.14.02026/06/114 个月前
2.13.12026/06/114 个月前
2.13.02026/05/046 个月前
2.12.02026/04/136 个月前
2.11.02026/04/136 个月前

其他发布通道:beta → 1.0.0-beta.150,rc → 2.3.0-rc.13。

关于 @algolia/satellite 的常见问题

@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 和提交记录判断。