@arch-ui/alert

中文文档
0.0.21发布于 2021/05/26MITESM + CJS近 30 天下载 4544

Alert component as used in @keystonejs Admin UI.

原始使用文档
文档目录8 节
  1. Install
  2. Usage
  3. Documentation
  4. Default
  5. Appearances
  6. Variations
  7. Full width alert
  8. License

import { Alert } from './src';

Arch Alert

TODO

  • npm version
  • build status

Alert messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don’t show more than one at a time.

This repository is a module of the full arch-ui repository.

Install

This repository is distributed with npm. After installing npm, you can install @arch-ui/alert with this command.

npm install --save @arch-ui/alert

# OR

yarn add @arch-ui/alert

Usage

Import the component into your application.

import { Alert } from '@arch-ui/alert';

To override the styles use the @arch-ui/theme package.

Documentation

Alert messages, or alerts, inform users of successful or pending actions. Use them sparingly. Don't show more than one at a time.

Default

Alert messages start off looking decently neutral—they're just light blue rounded rectangles.

<Alert>Alert message goes here.</Alert>

Alert message goes here.

You can put multiple paragraphs of text in an alert—the last paragraph's bottom margin will be automatically override.

<Alert>
  <p>
    This is a longer alert in its own paragraph. It ends up looking something like this. If we keep
    adding more text, it'll eventually wrap to a new line.
  </p>
  <p>And this is another paragraph.</p>
</Alert>

This is a longer alert in its own paragraph. It ends up looking something like this. If we keep adding more text, it'll eventually wrap to a new line.

And this is another paragraph.

Should the need arise, you can quickly space out your alert from surrounding content with an AlertGroup wrapper. Note the extra top and bottom margin in the example below.

import { Alert, AlertGroup } from '@arch-ui/alert';

<AlertGroup>
  <Alert>Alert message goes here.</Alert>
  <Alert>Alert message goes here.</Alert>
</AlertGroup>;

Appearances

info success warning danger

Add the appearance property warning, danger, or success to the alert to make it yellow, red, or green, respectively.

<Alert appearance="warning">Alert message goes here.</Alert>

Alert message goes here.

<Alert appearance="danger">Alert message goes here.</Alert>

Alert message goes here.

<Alert appearance="success">Alert message goes here.</Alert>

Alert message goes here.

Variations

Alerts default to a subtle variant, but if you need to pack more punch, add the variant property bold.

<Alert appearance="danger" variant="bold">
  Alert message goes here.
</Alert>
Alert message goes here.

Full width alert

An alert that is full width; removes border and border radius.

<Alert isFullWidth>
  <Container>Full width alert.</Container>
</Alert>

License

MIT © Thinkmill

版本与发布记录

@arch-ui/alert 共发布 21 个版本,首次发布于 2019/02/18;过去 12 个月发布了 0 个版本。

版本发布日期距今
0.0.21latest2021/05/265 年前
0.0.202021/04/145 年前
0.0.192021/02/235 年前
0.0.18parapetjagatiquoinrotundascrolldormer2020/08/316 年前
0.0.172020/04/236 年前
0.0.162020/04/066 年前

关于 @arch-ui/alert 的常见问题

@arch-ui/alert 是什么?

Alert component as used in @keystonejs Admin UI.

如何安装 @arch-ui/alert?

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

@arch-ui/alert 支持 TypeScript 吗?

该包的 package.json 没有声明类型入口。需要类型提示时,可以在 npm 上查找社区维护的 @types/arch-ui__alert 是否存在。

@arch-ui/alert 支持 ESM 还是 CommonJS?

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

@arch-ui/alert 可以商用吗?

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

@arch-ui/alert 的下载量有多少?

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

@arch-ui/alert 还在维护吗?

最新版本 0.0.21 发布于 2021/05/26(5 年前);至今共发布 21 个版本,其中过去 12 个月发布了 0 个;首次发布于 2019/02/18。发布频率只是参考信号:功能稳定的工具可能很少需要更新,建议结合源码仓库的 issue 和提交记录判断。