@brightlayer-ui/react-native-progress-icons

中文文档
2.3.0发布于 2026/10/07BSD-3-ClauseTypeScriptESM + CJS近 30 天下载 1.3万

React Native progress icons for Brightlayer UI applications

原始使用文档
文档目录8 节
  1. Installation
  2. Peer Dependencies
  3. Installation with Expo
  4. Using the progress icons in your application
  5. API
  6. Shared Properties
  7. Battery Properties
  8. Pie Properties

Brightlayer UI React Native Progress Icons

Progress icons

This is a library of icons with dynamic fill capabilities that can be used to show progress (similar to a traditional progress spinner or bar). These can be used to show health, battery life, etc.

Currently, we have icons available for:

  • battery
  • heart
  • pie
  • signal
  • ups
  • BatteryLarge

Installation

To install the Brightlayer UI progress icons from NPM as a dependency for your project, you can run the following command in your project root:

yarn add @brightlayer-ui/react-native-progress-icons

Peer Dependencies

In order to use this library, you must also have react-native-svg installed in your project. You can add it by running:

yarn add react-native-svg

Installation with Expo

If you are using Expo, the Expo client app already includes the necessary native code for react-native-svg.

Install the JavaScript dependency with:

npx expo install react-native-svg

See the Expo docs for more information.

Using the progress icons in your application

The progress icon components can be imported and used like you would use any other component.

import {Battery, Heart, Pie, Signal, BatteryLarge} from '@brightlayer-ui/react-native-progress-icons';

<Battery percent={100} size={36} color={'green'} charging={true} outlined={true}/>
<Heart percent={50} size={18} color={'pink'} outlined={true}/>
<Pie percent={50} size={48} color={'blue'} ring={4} outlined={true}/>
<Signal percent={75} size={48} color={'teal'} outlined={true}/>
<BatteryLarge percent={56} size={28} color={'yellow'} outlined={true}/>

API

Shared Properties

These props are available on all of the progress icons in this package.

Prop NameDescriptionTypeRequiredDefault
backgroundColorBackground color for the unfilled areastringno
colorThe color used for the icon fillstringyes
labelColorLabel text colorstringno
labelPositionWhere to display the text label'top' | 'bottom' | 'center' | 'right' | 'left'nocenter
labelSizeSize of the label in pxnumbernosize/4
outlinedWhether to use the outlined stylebooleannofalse
percentThe amount to fill the icon (0-100)numberno100
showPercentLabelOption to show percentage overlaybooleannofalse
sizeThe size of the icon (in px)numberno24

Any other props supplied will be provided to the root element (Svg).

Battery Properties

The battery supports all of the shared properties above and the following additional properties:

Prop NameDescriptionTypeRequiredDefault
chargingWhether to show the charging indicatorbooleannofalse

Pie Properties

The pie supports all of the shared properties above and the following additional properties:

Prop NameDescriptionTypeRequiredDefault
ringThe thickness of the outer ring (1 = thin ring, 10 = full circle )numberno10

版本与发布记录

@brightlayer-ui/react-native-progress-icons 共发布 16 个版本,首次发布于 2021/10/22;过去 12 个月发布了 9 个版本。

版本发布日期距今
2.3.0latest2026/10/071 个月前
2.3.0-alpha.0alpha2026/08/132 个月前
2.2.22026/04/077 个月前
2.2.12026/04/067 个月前
2.2.1-alpha.02026/04/067 个月前
2.2.02026/03/317 个月前

其他发布通道:beta → 1.0.2-beta.0,alpha → 2.3.0-alpha.0。

关于 @brightlayer-ui/react-native-progress-icons 的常见问题

@brightlayer-ui/react-native-progress-icons 是什么?

React Native progress icons for Brightlayer UI applications

如何安装 @brightlayer-ui/react-native-progress-icons?

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

@brightlayer-ui/react-native-progress-icons 支持 TypeScript 吗?

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

@brightlayer-ui/react-native-progress-icons 支持 ESM 还是 CommonJS?

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

@brightlayer-ui/react-native-progress-icons 可以商用吗?

@brightlayer-ui/react-native-progress-icons 使用 BSD-3-Clause 许可。宽松许可:允许商业使用、修改和再分发,通常只需在分发时保留原版权与许可声明。另外不得用原作者名义为衍生产品背书。以上为概括,不构成法律意见,请以许可原文为准。

@brightlayer-ui/react-native-progress-icons 的下载量有多少?

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

@brightlayer-ui/react-native-progress-icons 还在维护吗?

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