@alto-avios/alto-ui

中文文档
5.22.1发布于 2026/10/27MITTypeScriptES Module近 30 天下载 3653

A react component library for Alto Design System

原始使用文档
文档目录17 节
  1. Prerequisites
  2. Local Setup
  3. Running Linting & Formatting
  4. Running Tests
  5. Running Accessibility Tests
  6. Commiting code
  7. Running Storybook Locally
  8. Creating a new component
  9. Bundling the package with vite
  10. To create static Storybook files
  11. Run Chromatic (Dev)
  12. For Application using our package
  13. Install Package in Applications
  14. Importing Alto Components
  15. Update
  16. Node
  17. License

Alto UI

license

Zeroheight Documentation

Prerequisites

Before setting up the project, ensure you have the following installed on your local machine:

  • Node.js: v20.11.1 (as recommended)
  • NPM: Comes with Node.js
  • nvm: (Optional, but recommended for managing Node versions)

Local Setup

Clone the repository from our github repository here: https://github.com/IAG-Loyalty/alto-ui

You will need to setup a personal access token.

Once cloned simply run

npm i

This should install the avios tokens package too which can be located in your node_modules folder.

Running Linting & Formatting

For linting and formatting we use ESLint and Prettier. You can run with the following command:

npm run lint

Running Tests

If you want to run the tests for this project, you can do so with the following command:

npm run test

Running Accessibility Tests

If you want to run accessibility tests for this project, you can do so with the following command:

npm run test-a11y

Commiting code

We're using commitizen to enforce conventional commits.

git add . npm run commit

Running Storybook Locally

To run storybook locally run the following command

npm run storybook

Shared Spaces content-type docs are generated with npm run contentful:sync (see .storybook/contentful-addon/README.md).

Creating a new component

To scaffold a new component run the following command:

npm run generate

Bundling the package with vite

If you want to bundle the components for production, use the following command to create an optimized build:

npm run vite

To create static Storybook files

We need to create static storybook files for our public domain site to use. Run the following command

npm run build:storybook

Run Chromatic (Dev)

Run the following command to analyze our code and send to chromatic

npx chromatic --project-token <YOUR_PROJECT_TOKEN>

Project Token can be found in the chromatic dashboard

For Application using our package

Install Package in Applications

Install the Avios Alto Component Library package

npm install @alto-avios/alto-ui

Importing Alto Components

After following the installation process, you can import and use Alto-UI components in your React application. Here is an example of how to do it.

import { Button } from '@alto-avios/alto-ui';

const App = () => (
  <div>
    <Button>Click Me!</Button>
  </div>
);

export default App;

Update

Check if an update exists:

npm outdated

If an update is available, update the package:

npm i @alto-avios/alto-ui@latest

Node

Make sure to use Node -v 20.11.1.

Follow these steps to verify and install the required Node.js version for this project: Open your terminal.

Check the current version of Node.js installed on your system by running the following command:

node -v ​ Check the output. If it is not version 20.11.1, you will need to install this version.

If you don't have a Node version manager, install one. We recommend using NVM (Node Version Manager).

Install Node.js version 20.11.1 using your version manager. If you're using NVM, the command is:

nvm install 20.11.1 ​ Once the installation is complete, verify the installation by checking the Node.js version again:

node -v ​ The output should now be 20.11.1. You can now proceed with the project setup.

License

This project is licensed under the terms of the MIT license.

版本与发布记录

@alto-avios/alto-ui 共发布 135 个版本,首次发布于 2024/07/22;过去 12 个月发布了 57 个版本。

版本发布日期距今
5.22.1latest2026/10/2711 天前
5.22.1-experimental.1experimental2026/10/2216 天前
5.22.1-experimental.02026/10/2216 天前
5.22.02026/10/2018 天前
6.0.0--alpha.0alpha2026/10/1226 天前
5.21.02026/10/061 个月前

关于 @alto-avios/alto-ui 的常见问题

@alto-avios/alto-ui 是什么?

A react component library for Alto Design System

如何安装 @alto-avios/alto-ui?

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

@alto-avios/alto-ui 支持 TypeScript 吗?

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

@alto-avios/alto-ui 支持 ESM 还是 CommonJS?

以 ES Module 形式发布,推荐使用 import 引入。在 CommonJS 项目中,Node.js 20.19+ / 22.12+ 可以直接 require() 不含顶层 await 的 ES Module,更早的版本需要改用动态 import()。

@alto-avios/alto-ui 可以商用吗?

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

@alto-avios/alto-ui 的下载量有多少?

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

@alto-avios/alto-ui 还在维护吗?

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