SkillAtlasSkill 详情

hiui

HiUI 是一个面向中后台系统的前端组件库,可以帮助开发人员快速实现交互一致、界面美观的界面开发。

审核状态:已审核Quality 72Security 70

复制安装命令

用 Codex 或 Claude 安装复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它先审查 Skill 页面再帮你安装。

复制前请先查看来源、License 和安全提示。

项目 README

来源文件:README.md

抓取于 2026年7月29日

HiUI Logo

HiUI

JavaScript Style Guide


|简体中文|ENGLISH|

HiUI 是一个面向中后台系统的前端组件库,可以帮助开发人员快速实现交互一致、界面美观的界面开发。

特性

  • 精于中后台产品的交互与视觉设计
  • 全面的流程、数据展示模板,从业务中来,模板、组件覆盖大多数中后台系统需求
  • 数据结构分离的单组件设计,无需学习,升级方便,开箱即用

安装

现在从 npm 安装并引入 HiUI。

全量安装

npm config set registry https://registry.npmjs.org

npm install @hi-ui/core @hi-ui/hiui

按需安装

npm config set registry https://registry.npmjs.org

npm install @hi-ui/core @hi-ui/组件名

注意:组件名请全部小写,并使用中横线连接。

使用

贡献

HiUI 贡献详见贡献指南。

License

MIT

-- EOF --

其他

中风险

  • 来源需自行核对维护者身份。
  • 包含脚本或命令调用,安装前请复核。
  • 可能需要外部 token、网络权限或第三方服务。
  • 未检测到高风险命令。
  • 扫描发现:3 条。

Codex — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/XiaoMi/hiui.git
  3. 将 "skills/hiui" 文件夹复制到 Codex 的 skills 目录中。
  4. 重启 Codex 让新的 skill 生效。

Codex — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Codex 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Codex 让新的 skill 生效。

Claude Code — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/XiaoMi/hiui.git
  3. 将 "skills/hiui" 文件夹复制到 Claude Code 的 skills 目录中。
  4. 重启 Claude Code 让新的 skill 生效。

Claude Code — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Claude Code 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Claude Code 让新的 skill 生效。

Cursor — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/XiaoMi/hiui.git
  3. 将 "skills/hiui" 文件夹复制到 Cursor 的 skills 目录中。
  4. 重启 Cursor 让新的 skill 生效。

Cursor — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Cursor 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Cursor 让新的 skill 生效。

GitHub Copilot — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/XiaoMi/hiui.git
  3. 将 "skills/hiui" 文件夹复制到 GitHub Copilot 的 skills 目录中。
  4. 重启 GitHub Copilot 让新的 skill 生效。

GitHub Copilot — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 GitHub Copilot 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 GitHub Copilot 让新的 skill 生效。

Windsurf — Git Clone 安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 克隆仓库:git clone https://github.com/XiaoMi/hiui.git
  3. 将 "skills/hiui" 文件夹复制到 Windsurf 的 skills 目录中。
  4. 重启 Windsurf 让新的 skill 生效。

Windsurf — 手动复制安装

  1. 安装前请先查看来源仓库和风险报告。
  2. 从源仓库下载 SKILL.md 及相关文件。
  3. 在 Windsurf 的 skills 目录中创建新文件夹。
  4. 将所有 skill 文件复制到新文件夹中。
  5. 重启 Windsurf 让新的 skill 生效。
查看 SKILL.md 原文
name: hiui
description: >
  Use when the user's task involves HiUI (@hi-ui/*) — writing HiUI components,
  debugging HiUI issues, querying HiUI props/docs, migrating from HiUI V4 to V5,
  or setting up React 19 compatibility with @hi-ui/patch-for-react. Triggers on
  imports from '@hi-ui/*', hi-ui/hiui mentions, or explicit HiUI questions.
allowed-tools:
  - Bash(hiui *)
  - Bash(npm install -g @hi-ui/hiui-cli*)
  - Bash(which hiui)

HiUI CLI

You have access to @hi-ui/hiui-cli — a CLI for querying HiUI component documentation and automating common upgrade tasks. Component docs are fetched from official llms endpoints (network required for list / doc / info / url). Migration and React 19 patch setup run locally on the project filesystem.

Setup

Before first use, check if the CLI is installed. If not, install it:

which hiui || npm install -g @hi-ui/hiui-cli
hiui version

The hiui command comes from the globally installed @hi-ui/hiui-cli package.

Always use --format json for structured output you can parse programmatically.

Scenarios

1. Writing HiUI component code

Before writing any HiUI component code, look up its API first — don't rely on memory.

# Check available props
hiui info Button --format json

# Full docs with usage examples (TSX demos in markdown)
hiui doc Button --format json

# Get the canonical llms URL for citations
hiui url Button --format json

Workflow: hiui info → understand props → hiui doc → read examples → write code.

HiUI packages use kebab-case names (@hi-ui/date-picker). Component CLI args accept Button, datePicker, or date-picker (auto-normalized to kebab-case).

Import patterns:

// Full bundle
import { Button, Input } from '@hi-ui/hiui'

// Per-component (recommended for existing apps)
import Button from '@hi-ui/button'
import Input from '@hi-ui/input'
import { InfoCircleFilled } from '@hi-ui/icons'

2. Looking up full documentation

When you need comprehensive component docs (not just props):

hiui doc Table --format json

Markdown includes description, usage examples, and props tables. Source: https://xiaomi.github.io/hiui/llms/<component>.md.

3. Exploring available components

When choosing which component to use:

hiui list --format json

Index is derived from llms.txt. For offline context, you can also reference llms-full.txt.

4. Migrating HiUI V4 → V5

When upgrading a project from HiUI 4.x to 5.x:

# Preview changes (no writes)
hiui migrate 4 5 --dry-run --format json

# Apply to current directory
hiui migrate 4 5 --format json

# Monorepo sub-app
hiui migrate 4 5 --path ./apps/web --format json

# Only bump @hi-ui/* in package.json
hiui migrate 4 5 --deps-only

# Only replace .hi-v4 / hi-v4- class prefixes
hiui migrate 4 5 --class-only

What migrate 4 5 does:

  1. Sets @hi-ui/* in all package.json files to ^5.0.0 (excludes tooling like @hi-ui/hi-build)
  2. Replaces .hi-v4 → .hi-v5 and hi-v4- → hi-v5- in project source/styles

What it does NOT do: API breaking changes, import path refactors, or business logic. After migrate, run npm install or yarn, then fix remaining issues manually. See project migration docs.

Workflow: hiui migrate 4 5 --dry-run → review → hiui migrate 4 5 → install deps → hiui doc / hiui info per changed component → fix API usage.

Currently only 4 → 5 is supported; other version pairs return UNSUPPORTED_MIGRATION.

5. React 19 compatibility

When the project uses React 19 and needs ReactDOM.render / legacy static APIs patched for HiUI:

hiui patch-for-react --dry-run --format json
hiui patch-for-react --path . --format json
hiui patch-for-react --entry src/index.tsx --skip-install

What it does:

  1. Adds @hi-ui/patch-for-react to dependencies (^5.0.0 by default, override with --patch-version)
  2. Inserts import '@hi-ui/patch-for-react' at the top of the entry file (after 'use client' if present)
  3. Runs npm / yarn / pnpm install unless --skip-install

Entry auto-detection: src/index.tsx, src/main.tsx, etc., or script src from index.html.

6. Customizing docs source

When using a mirror or internal docs host:

hiui doc alert --base-url https://xiaomi.github.io/hiui --format json
# or
HIUI_DOCS_BASE_URL=https://your-mirror.example hiui list --format json

7. Semantic classNames / styles

Many HiUI 5 components support classNames and styles for per-element styling. Check the Semantic example in component docs:

hiui doc Alert --format json

Look for classNames / styles usage in the markdown examples.

8. Alternative: LLMs.txt without CLI

If the CLI is unavailable, fetch docs directly:

Global Flags

FlagPurpose
--format jsonStructured JSON output (agents should prefer this)
--base-url <url>Docs root (default: https://xiaomi.github.io/hiui)
--timeout <ms>HTTP timeout for doc fetch (default: 30000)
-V, --versionPrint CLI version (hiui version also works)

migrate options

FlagPurpose
--path <dir>Project root (default: .)
--dry-runPreview without writing
--deps-onlyOnly update package.json
--class-onlyOnly replace class name prefixes

patch-for-react options

FlagPurpose
--path <dir>Project root
--entry <file>Explicit entry file
--dry-runPreview only
--skip-installSkip package manager install
--patch-version <range>Version for @hi-ui/patch-for-react (default: ^5.0.0)

Key Rules

  1. Always query before writing — Don't guess HiUI APIs from memory. Run hiui info or hiui doc first.
  2. Use --format json — Parse JSON output instead of regex-matching plain text.
  3. Prefer hiui doc for examples — Demos live inside markdown; there is no separate hiui demo command yet.
  4. Migrate with preview — Run hiui migrate 4 5 --dry-run before applying; then install deps and fix API changes manually.
  5. React 19 patch is entry-level — patch-for-react only adds the side-effect import; ensure it runs before other app imports.
  6. Component names are kebab-case in packages — CLI normalizes CheckSelect → check-select for URLs and docs.
  7. Network for docs commands — list, doc, info, url need HTTP access to the llms host; migrate and patch-for-react are offline filesystem operations.

Command Reference

CommandDescription
hiui versionCLI version
hiui listAll components from llms.txt
hiui info <component>Props API
hiui doc <component>Full markdown documentation
hiui url <component>llms.md URL for component
hiui migrate 4 5V4 → V5 dependency + class prefix upgrade
hiui patch-for-reactInstall and inject React 19 patch

Related Links

发现问题?提交给管理员复核

评分:

评论 (0)

暂无评论,成为第一个评论者吧!