Taro Ui Guide logo

Taro Ui Guide

OrganizationPopular
jd-opensource
taro-ui-guide

Guides installation, Taro config, styling, and usage of taro-ui (At* components) for WeChat/Alipay/H5/RN. Use when building Taro apps with taro-ui, picking components, theming, i18n, or modifying packages/taro-ui source.

Overview

Publisherjd-opensource
Repositorytaro-ui
Skill nametaro-ui-guide
Stars
4.7K
Forks
740
Bundled files
47
LicenseMIT
Links
  • Markdown instructions

    A SKILL.md file the model loads on demand, so it only costs tokens when a request actually matches.

  • Works with any LLM

    AI skills are plain Markdown, not provider-specific code, so this works with GPT, Claude, Gemini, Grok, or a local model.

  • 47 bundled files

    Scripts, templates, and references the model can read while it works. Files are read-only and never executed.

  • Open source

    Published by jd-opensource on GitHub. Read the source before you install it.

Installation

Install the Taro Ui Guide AI skill in TypingMind to use it with any LLM, or drop it into another agent that reads SKILL.md.

1

Install in TypingMind

TypingMind installs a skill straight from its GitHub folder — it reads SKILL.md, bundles the resource files, and stores the result locally.

  1. Open the app and go to Plugins → Skills.
  2. Choose "Install from GitHub".
  3. Paste the skill folder URL below and confirm.
  4. Enable the skill in any chat where you want it available.
Plugins → Skills → Add skill → From GitHub URL, then paste the folder URL and press Continue.
2

Install in another agent

Any agent that reads the Agent Skills format can use this skill — copy the folder into that agent's skills directory.

Claude Code — .claude/skills
git clone --depth 1 https://github.com/jd-opensource/taro-ui.git /tmp/taro-ui
mkdir -p .claude/skills
cp -r /tmp/taro-ui/packages/taro-ui-guide .claude/skills/taro-ui-guide
Restart Claude Code after copying so it picks up the new skill.

Use it in TypingMind

Enable Taro Ui Guide in any TypingMind chat and the model takes it from there. Its name and description sit in the system prompt, and the moment a request matches, the model loads the full instructions itself — you never invoke it by hand, and it costs no tokens until it is actually used.

The model loads Taro Ui Guide on its own as soon as a request matches it.

Works with any AI model

AI skills are plain Markdown instructions rather than provider-specific code, so Taro Ui Guide is not tied to the model it was written for. Install it once in TypingMind and use it with GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama, or a local model you run yourself — all on your own API keys.

  • Loaded only when it is needed

    The system prompt carries just the name and description. The instructions are fetched on the first matching request, so an idle skill costs nothing.

  • Switch models mid-chat

    Because the skill is instructions rather than code, changing model does not break it — the next model reads the same SKILL.md.

Skill instructions

This is the SKILL.md content the model loads. Read it before installing — a skill is instructions your model will follow.

Taro UI 使用指南

基于 Taro 3+ 的多端 React 组件库。组件均以 At 前缀导出(如 AtButton),样式与逻辑分离,需单独引入 SCSS。

官方文档:https://jd-opensource.github.io/taro-ui/#/
源码:packages/taro-ui/(本 monorepo)

何时使用本 Skill

  • 在 Taro 项目中集成、配置或排查 taro-ui
  • 选择/组合组件、查 Props、写示例页面
  • 自定义主题、国际化、按需加载
  • 在本仓库内开发/修复 packages/taro-ui 组件

版本与安装

Taro 版本taro-ui 版本
< 3taro-ui@2.3.4
≥ 3taro-ui@latest(当前 monorepo 为 3.x)
bash
pnpm add taro-ui
# 或 npm install taro-ui@latest

Peer 依赖@tarojs/taro@tarojs/components@tarojs/reactreactreact-dom(≥16.13)。RN 端另需 react-nativereact-native-modal(可选)。

微信小程序需基础库 ≥ 2.2.3globalClass 与样式穿透)。

Taro 项目必配项

在消费方项目的 config/index.ts(或 config/index.js)中:

1. H5 编译 node_modules 中的 taro-ui

js
h5: {
  esnextModules: ['taro-ui']
}

2. Taro 3.5+ 关闭对 taro-ui 的 prebundle(否则 @tarojs/components 可能未打进 bundle,页面异常)

js
compiler: {
  type: 'webpack5',
  prebundle: {
    exclude: ['taro-ui']
  }
}

样式引入

样式在 taro-ui/dist/style/不会随 JS 自动注入,必须显式引入。

全量(开发/原型)

入口或 app.scss

js
import 'taro-ui/dist/style/index.scss'
scss
@import 'taro-ui/dist/style/index.scss';

按需(推荐生产)

页面/全局 SCSS 按组件名引入(AtButtonbutton.scss):

scss
@import 'taro-ui/dist/style/components/button.scss';

或用 babel-plugin-import(见 docs/docs/guide/quickstart.md):

js
// babel.config.js plugins
['import', {
  libraryName: 'taro-ui',
  customName: name => `taro-ui/lib/components/${name.slice(3)}`,
  customStyleName: name => `taro-ui/dist/style/components/${name.slice(3)}.scss`
}, 'taro-ui']

At 前缀去掉后即为目录名:AtActionSheetaction-sheet

组件使用模式

基础引入

tsx
import { View } from '@tarojs/components'
import { AtButton } from 'taro-ui'

export default function Page() {
  return (
    <View>
      <AtButton type="primary" onClick={() => {}}>
        按钮
      </AtButton>
    </View>
  )
}

公共 Props(AtComponent

多数组件支持:

Prop说明
className外层类名(小程序可用 globalClass 覆盖内部 BEM 类)
customStyle内联样式,stringCSSProperties
children子节点

类型定义:packages/taro-ui/types/base.d.ts

复合组件

按文档组合子组件,例如:

  • AtModal + AtModalHeader / AtModalContent / AtModalAction
  • AtList + AtListItem
  • AtTabs + AtTabsPane
  • AtActionSheet + AtActionSheetItem

按组件查阅:references/README.md(如 references/button.md)。仅在使用该组件时打开对应文件。

受控与回调

  • 开关类:open / isOpened + onClick / onClose(以各组件 types/*.d.ts 为准)
  • 表单类:AtForm 包裹 AtInputAtSwitch 等,注意 formType、校验文案
  • 环境判断:组件内部常用 Taro.getEnv() 区分 WEB / WEAPP / ALIPAY

查 Props 时优先读 references/<slug>.md,其次 packages/taro-ui/types/<component>.d.tsdocs/docs/components/<name>.md

命令式 API:AtMessage

页面需挂载 <AtMessage />,再通过 Taro.atMessage 调用:

tsx
import Taro from '@tarojs/taro'
import { AtMessage } from 'taro-ui'

// render 中: <AtMessage />
Taro.atMessage({ message: '提示', type: 'success', duration: 3000 })
// type: info | success | error | warning

AtToast 为声明式:isOpenedtextstatusonClose

国际化 ConfigProvider

tsx
import { ConfigProvider, AtLoadMore, enUS } from 'taro-ui'

export default function App({ children }) {
  return (
    <ConfigProvider locale={enUS}>
      {children}
    </ConfigProvider>
  )
}
  • 内置:zhCN(默认)、enUS
  • locale 与默认包深合并,可只覆盖部分 key(如 LoadMore.moreText
  • 优先级:组件 props > ConfigProvider.locale > 默认 zhCN

自定义主题

  1. SCSS 变量(推荐):在引入默认样式之前覆盖变量,再 @import 全量样式。
scss
$color-brand: #6190e8;
@import 'taro-ui/dist/style/index.scss';

变量表:packages/taro-ui/src/style/variables/default.scss

  1. globalClass:在 Page 级 SCSS 用 .my-btn.at-button { } 覆盖(自定义组件内无效)。

  2. customStyle:仅部分组件支持,优先用前两种方式。

AtSliderAtSwitch 暂不支持 SCSS 变量覆盖主题。

在本仓库开发 taro-ui

bash
pnpm install          # 根目录,仅允许 pnpm
pnpm build:ui         # 构建 packages/taro-ui → dist/
pnpm --filter demo dev:h5
pnpm --filter demo dev:weapp
pnpm --filter docs dev

组件实现路径:

内容路径
组件实现packages/taro-ui/src/components/<name>/
类型packages/taro-ui/types/<name>.d.ts
样式packages/taro-ui/src/style/components/<name>.scss
导出packages/taro-ui/src/index.ts
RN 实现packages/taro-ui/rn/components/
单测packages/taro-ui/test/components/

新增/修改组件:同步更新 src/index.ts、类型文件、样式、test 快照;提交信息格式 feat(ComponentName): ...(见 .github/CONTRIBUTING.md)。

Agent 工作流

  1. 确认场景:消费方 Taro 项目 vs 本 monorepo 源码修改。
  2. 查 APIreferences/<slug>.mdtypes/*.d.tsdocs/docs/components/*.md
  3. 写用法import { AtX } from 'taro-ui' + 对应 dist/style/components/x.scss
  4. 排查样式缺失:是否引入 SCSS;H5 是否配置 esnextModules;是否配置 prebundle.exclude
  5. 排查小程序样式:基础库版本、globalClass、BEM 类名是否与文档一致。

延伸阅读

  • references/README.md — 组件索引(按维度渐进披露)
  • docs/docs/guide/quickstart.md — 快速上手与 babel 按需
  • docs/docs/guide/customize-theme.md — 主题详解

Bundled files

The model reads these on demand while the skill is loaded. They are exposed as readable files and are never executed.

Frequently asked questions

What does the Taro Ui Guide AI skill do?

Guides installation, Taro config, styling, and usage of taro-ui (At* components) for WeChat/Alipay/H5/RN. Use when building Taro apps with taro-ui, picking components, theming, i18n, or modifying packages/taro-ui source.

Why use Taro Ui Guide on TypingMind?

Because you install it once and use it with any model. Taro Ui Guide is plain Markdown rather than provider-specific code, so the same skill runs on GPT-5, Claude, Gemini, Grok, or a local model — and you can switch model mid-chat without it breaking. TypingMind runs on your own API keys, so you pay providers directly instead of a per-seat subscription, and your skills and chats stay in your own storage.

How do I install Taro Ui Guide in TypingMind?

Open Plugins → Skills → Install from GitHub in TypingMind and paste https://github.com/jd-opensource/taro-ui/tree/next/packages/taro-ui-guide. TypingMind reads its SKILL.md and bundles its files and installs it as a skill you can enable per chat.

Which AI models can use Taro Ui Guide?

Any model you connect in TypingMind. AI skills are plain Markdown instructions rather than provider-specific code, so GPT, Claude, Gemini, Grok, and local models can all load this skill when a request matches it.

How many AI models can I use with Taro Ui Guide?

As many as you like. As long as a model supports skills, you can use Taro Ui Guide with it — GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama and more — all on TypingMind with your own API keys.

Is the Taro Ui Guide AI skill free?

Yes. It is published on GitHub by jd-opensource under the MIT license. You only pay your own AI provider for the tokens you use.

What are AI skills?

An AI skill is a reusable instruction bundle that teaches an AI model how to do one specific task. It follows the open Agent Skills format: a SKILL.md file with a name and description, plus any scripts, templates or reference files the model may need. The model reads the instructions only when your request matches the skill, so an installed skill costs nothing until it is used.

How are AI skills different from plugins or MCP servers?

A plugin or MCP server gives a model new tools to call — code that runs somewhere and returns a result. An AI skill gives the model knowledge and process instead: how to approach a task, which steps to follow, what good output looks like. Skills are plain Markdown, so they need no server, no API key and no runtime, and they work with any model.

View all

Set up your own AI workspace now

Get notified about new features and future giveaways by subscribing to our newsletter 👇