@canton-network/core-wallet-ui-components

中文文档
1.19.0发布于 2026/11/06Apache-2.0TypeScriptESM + CJS近 30 天下载 2.4万

Reusable UI components for the Splice wallet

原始使用文档
文档目录5 节
  1. Overview
  2. Installation
  3. Run
  4. Usage
  5. Theming

Wallet UI Components

This workspace contains UI components for the Wallet Gateway, implemented with Web Components.

Overview

This package provides a modular set of UI building blocks and utilities for wallet-related web applications.

components: Contains reusable web components (such as headers, layouts, and forms) that can be used across different wallet UIs. These components are designed for flexibility and composability.

windows: Provides predefined window-based functionalities, such as wallet discovery dialogs. These are typically used by higher-level packages like the SDK to implement user flows that require popups or modal interactions.

themes: Includes the default theme (CSS custom properties and styles) to ensure a consistent look and feel across all components and windows. This theme can be extended or overridden as needed.

Together, this package enables rapid development of wallet UIs with a consistent user experience and shared logic.

Installation

This package requires NodeJS v16 or higher and can be added to your project using:

npm install @canton-network/core-wallet-ui-components --save

or

pnpm add @canton-network/core-wallet-ui-components

Run

To build the package, run:

pnpm build

To start a local web development server for interactive testing and development, run:

pnpm dev

Usage

The main entry point for building wallet UIs is the AppLayout component. The AppLayout provides a consistent page structure (e.g. encapsulates the AppHeader), and automatically includes the Bootstrap CSS framework along with a default theme for a unified look and feel.

Basic usage:

  <body>
      <app-layout>
          <you-component></your-component>
      </app-layout>
  </body>

You can also customize the layout by specifying a custom icon or stylesheet:

  <app-layout iconSrc="images/icon.png" themeSrc="css/custom.css">
      <you-component></your-component>
  </app-layout>
  • iconSrc: Path to a custom icon displayed in the header.
  • themeSrc: Path to an alternative CSS file for custom theming.

This approach allows you to rapidly compose wallet UIs with a consistent structure and appearance, while still supporting customization as needed.

Theming

Components take their colours, fonts, spacing and radii from CSS custom properties, in two layers (see themes/default.css):

  • --wg-theme-* are the base tokens, such as --wg-theme-accent-color and --wg-theme-text-rgb. Override them on :root or on any ancestor element. They inherit through shadow roots, so they also reach components that are nested inside other components.
  • --wg-* are the aliases the components use. Components declare them on :host, so don't override these from a page: set the base token instead.

Colours that are used as rgba(var(--x), alpha) have a -rgb token that takes r, g, b (--wg-theme-accent-rgb, --wg-theme-primary-rgb, --wg-theme-text-rgb and so on). Set both when you change such a colour. --wg-theme-shade-rgb is the colour of the faint tints and borders.

New component styles should use --wg-* tokens and not literal colours, so that a page can theme them.

版本与发布记录

@canton-network/core-wallet-ui-components 共发布 78 个版本,首次发布于 2025/08/29;过去 12 个月发布了 64 个版本。

版本发布日期距今
1.19.0latest2026/11/063 天前
1.18.02026/10/2910 天前
1.14.1-backport.3bugfix2026/10/2613 天前
1.17.02026/10/2317 天前
1.16.02026/10/1227 天前
1.14.1-backport.12026/10/031 个月前

关于 @canton-network/core-wallet-ui-components 的常见问题

@canton-network/core-wallet-ui-components 是什么?

Reusable UI components for the Splice wallet

如何安装 @canton-network/core-wallet-ui-components?

在项目目录运行 npm install @canton-network/core-wallet-ui-components,或使用 pnpm add / yarn add / bun add。

@canton-network/core-wallet-ui-components 支持 TypeScript 吗?

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

@canton-network/core-wallet-ui-components 支持 ESM 还是 CommonJS?

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

@canton-network/core-wallet-ui-components 可以商用吗?

@canton-network/core-wallet-ui-components 使用 Apache-2.0 许可。宽松许可:允许商业使用、修改和再分发,并附带明确的专利授权;分发时需保留许可与 NOTICE 文件,修改过的文件要注明改动。以上为概括,不构成法律意见,请以许可原文为准。

@canton-network/core-wallet-ui-components 的下载量有多少?

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

@canton-network/core-wallet-ui-components 还在维护吗?

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