Logo vun Tdesign Miniprogram

Tdesign Miniprogram

Communautéit
bighardperson
tdesign-miniprogram

TDesign WeChat Mini Program UI component library by Tencent. Use when building WeChat mini apps with TDesign components (Button, Dialog, Input, Tabs, Chat, etc.), implementing TDesign design system, customizing themes/dark mode, or building AI chat interfaces in mini programs.

Iwwersiicht

Editeurbighardperson
Repositorycomputer-science-skills-collection
Skill-Nummtdesign-miniprogram
Stären
66
Forks
10
Matgeliwwert Fichieren
76
Linken
  • Instruktiounen am Markdown-Format

    Eng SKILL.md-Datei, déi de Modell bei Bedarf luet, soudatt nëmmen Token ufalen, wann eng Ufro tatsächlech dozou passt.

  • Funktionéiert mat all LLM

    KI-Skills si reng Markdown, keen ubidderspezifesche Code. Dofir funktionéiert dëse Skill mat GPT, Claude, Gemini, Grok oder engem lokale Modell.

  • 76 matgeliwwert Dateien

    Skripten, Virlagen a Referenzen, déi de Modell beim Schaffe liese kann. D'Dateie kënnen nëmme gelies ginn a ginn ni ausgeféiert.

  • Open Source

    Vum bighardperson op GitHub verëffentlecht. Liest de Quelltext, ier Dir de Skill installéiert.

Installatioun

Installéiert de KI-Skill Tdesign Miniprogram an TypingMind, fir e mat all LLM ze benotzen, oder füügt en an en anere KI-Agent an, deen SKILL.md liest.

1

An TypingMind installéieren

TypingMind installéiert e Skill direkt aus sengem GitHub-Dossier — dobäi gëtt SKILL.md gelies, d'Ressourcedateie gi gebëndelt an d'Resultat gëtt lokal gespäichert.

  1. Maacht d'App op a gitt op Plugins → Skills.
  2. Wielt „Vun GitHub installéieren“.
  3. Pecht d'URL vum Skill-Dossier hei drënner an a bestätegt.
    https://github.com/bighardperson/computer-science-skills-collection/tree/main/skills/TDesign%20微信小程序组件
  4. Aktivéiert de Skill an all Chat, an deem Dir e benotze wëllt.
Plugins → Skills → Skill afügen → Vu GitHub-URL, pecht dann d'URL vum Dossier an a klickt op Weider.

An TypingMind benotzen

Aktivéiert Tdesign Miniprogram an engem Chat vun TypingMind, an de Modell iwwerhëlt de Rescht. Den Numm an d'Beschreiwung stinn am System-Prompt. Soubal eng Ufro dozou passt, luet de Modell déi komplett Instruktioune selwer — Dir musst de Skill ni manuell opruffen, an et fale keng Token un, bis en tatsächlech benotzt gëtt.

De Modell luet Tdesign Miniprogram automatesch, soubal eng Ufro dozou passt.

Funktionéiert mat all KI-Modell

KI-Skills si reng Markdown-Instruktiounen amplaz vun ubidderspezifeschem Code. Dofir ass Tdesign Miniprogram net un de Modell gebonnen, fir deen de Skill geschriwwe gouf. Installéiert en eemol an TypingMind a benotzt e mat GPT-5, Claude, Gemini, Grok, DeepSeek, Mistral, Llama oder engem lokale Modell, deen Dir selwer bedreift — alles mat Ären eegenen API-Keys.

  • Gëtt nëmme gelueden, wann et néideg ass

    De System-Prompt enthält nëmmen den Numm an d'Beschreiwung. D'Instruktioune gi bei der éischter passender Ufro gelueden, soudatt en onbenotzte Skill näischt kascht.

  • De Modell am lafende Chat wiesselen

    Well de Skill aus Instruktiounen amplaz vu Code besteet, funktionéiert en och no engem Modellwiessel — den nächste Modell liest déi selwecht SKILL.md-Datei.

Skill-Instruktiounen

Dëst ass den Inhalt vu SKILL.md, deen de Modell luet. Liest e virun der Installatioun — e Skill besteet aus Instruktiounen, déi Äre Modell befollegt.

TDesign Mini Program Skill

TDesign WeChat Mini Program component library, an enterprise-level design system by Tencent. Provides 60+ high-quality components with dark mode support, theme customization, and more.

When to Use This Skill

This skill should be triggered when:

  • Developing WeChat Mini Programs with TDesign component library
  • Using TDesign UI components (Button, Input, Dialog, etc.)
  • Implementing interfaces following TDesign design specifications
  • Configuring TDesign themes and style customization
  • Building AI chat interfaces (using TDesign Chat components)
  • Implementing dark mode adaptation

Quick Start

Installation

bash
npm i tdesign-miniprogram -S --production

Modify app.json

Remove "style": "v2" from app.json to avoid style conflicts.

Modify project.config.json

Add the following to the setting section of project.config.json:

json
{
  "setting": {
    "packNpmManually": true,
    "packNpmRelationList": [
      {
        "packageJsonPath": "./package.json",
        "miniprogramNpmDistDir": "./"
      }
    ]
  }
}

Modify tsconfig.json (TypeScript projects)

json
{
  "paths": {
    "tdesign-miniprogram/*": [
      "./miniprogram/miniprogram_npm/tdesign-miniprogram/*"
    ]
  }
}

After modifying project.config.json, build npm in WeChat DevTools: Tools - Build npm

After successful build, check Compile JS to ES5

Using Components

Import in page or component JSON file:

json
{
  "usingComponents": {
    "t-button": "tdesign-miniprogram/button/button"
  }
}

Use in WXML:

html
<t-button theme="primary">Button</t-button>

Component Categories

Basic Components (6)

ComponentDescriptionImport Path
ButtonButtontdesign-miniprogram/button/button
DividerDividertdesign-miniprogram/divider/divider
FabFloating Action Buttontdesign-miniprogram/fab/fab
IconIcontdesign-miniprogram/icon/icon
LayoutLayouttdesign-miniprogram/row/row
LinkLinktdesign-miniprogram/link/link

Navigation Components (8)

ComponentDescriptionImport Path
BackTopBack to Toptdesign-miniprogram/back-top/back-top
DrawerDrawertdesign-miniprogram/drawer/drawer
IndexesIndex Listtdesign-miniprogram/indexes/indexes
NavbarNavigation Bartdesign-miniprogram/navbar/navbar
SideBarSide Navigationtdesign-miniprogram/side-bar/side-bar
StepsStepstdesign-miniprogram/steps/steps
TabBarBottom Tab Bartdesign-miniprogram/tab-bar/tab-bar
TabsTabstdesign-miniprogram/tabs/tabs

Input Components (16)

ComponentDescriptionImport Path
CalendarCalendartdesign-miniprogram/calendar/calendar
CascaderCascadertdesign-miniprogram/cascader/cascader
CheckBoxCheckboxtdesign-miniprogram/checkbox/checkbox
DateTimePickerDate Time Pickertdesign-miniprogram/date-time-picker/date-time-picker
InputInputtdesign-miniprogram/input/input
PickerPickertdesign-miniprogram/picker/picker
RadioRadiotdesign-miniprogram/radio/radio
RateRatetdesign-miniprogram/rate/rate
SearchSearchtdesign-miniprogram/search/search
SliderSlidertdesign-miniprogram/slider/slider
StepperSteppertdesign-miniprogram/stepper/stepper
SwitchSwitchtdesign-miniprogram/switch/switch
TextareaTextareatdesign-miniprogram/textarea/textarea
TreeSelectTree Selecttdesign-miniprogram/tree-select/tree-select
UploadUploadtdesign-miniprogram/upload/upload
FormFormtdesign-miniprogram/form/form

Data Display Components (18)

ComponentDescriptionImport Path
AvatarAvatartdesign-miniprogram/avatar/avatar
BadgeBadgetdesign-miniprogram/badge/badge
CellCelltdesign-miniprogram/cell/cell
CollapseCollapsetdesign-miniprogram/collapse/collapse
CountDownCountdowntdesign-miniprogram/count-down/count-down
EmptyEmpty Statetdesign-miniprogram/empty/empty
FooterFootertdesign-miniprogram/footer/footer
GridGridtdesign-miniprogram/grid/grid
ImageImagetdesign-miniprogram/image/image
ImageViewerImage Viewertdesign-miniprogram/image-viewer/image-viewer
ProgressProgresstdesign-miniprogram/progress/progress
ResultResulttdesign-miniprogram/result/result
SkeletonSkeletontdesign-miniprogram/skeleton/skeleton
StickyStickytdesign-miniprogram/sticky/sticky
SwiperSwipertdesign-miniprogram/swiper/swiper
TableTabletdesign-miniprogram/table/table
TagTagtdesign-miniprogram/tag/tag
ListListtdesign-miniprogram/list/list

Feedback Components (12)

ComponentDescriptionImport Path
ActionSheetAction Sheettdesign-miniprogram/action-sheet/action-sheet
DialogDialogtdesign-miniprogram/dialog/dialog
DropdownMenuDropdown Menutdesign-miniprogram/dropdown-menu/dropdown-menu
GuideGuidetdesign-miniprogram/guide/guide
LoadingLoadingtdesign-miniprogram/loading/loading
MessageMessagetdesign-miniprogram/message/message
NoticeBarNotice Bartdesign-miniprogram/notice-bar/notice-bar
OverlayOverlaytdesign-miniprogram/overlay/overlay
PopupPopuptdesign-miniprogram/popup/popup
PullDownRefreshPull Down Refreshtdesign-miniprogram/pull-down-refresh/pull-down-refresh
SwipeCellSwipe Celltdesign-miniprogram/swipe-cell/swipe-cell
ToastToasttdesign-miniprogram/toast/toast

AI Chat Components (9)

ComponentDescriptionImport Path
ChatListChat Listtdesign-miniprogram/chat-list/chat-list
ChatMessageChat Messagetdesign-miniprogram/chat-message/chat-message
ChatSenderChat Sendertdesign-miniprogram/chat-sender/chat-sender
ChatContentChat Contenttdesign-miniprogram/chat-content/chat-content
ChatActionbarChat Action Bartdesign-miniprogram/chat-actionbar/chat-actionbar
ChatLoadingChat Loadingtdesign-miniprogram/chat-loading/chat-loading
ChatMarkdownChat Markdowntdesign-miniprogram/chat-markdown/chat-markdown
ChatThinkingChat Thinkingtdesign-miniprogram/chat-thinking/chat-thinking
AttachmentsAttachmentstdesign-miniprogram/attachments/attachments

Common Patterns

Button

html
<!-- Basic Buttons -->
<t-button theme="primary" size="large">Primary Button</t-button>
<t-button theme="light" size="large">Light Button</t-button>
<t-button size="large">Default Button</t-button>

<!-- Outline and Text Buttons -->
<t-button theme="primary" size="large" variant="outline"
  >Outline Button</t-button
>
<t-button theme="primary" size="large" variant="text">Text Button</t-button>

<!-- Icon Button -->
<t-button
  theme="primary"
  icon="app"
  content="Icon Button"
  size="large"
></t-button>

<!-- Loading State -->
<t-button theme="primary" size="large" loading>Loading</t-button>

<!-- Disabled State -->
<t-button theme="primary" size="large" disabled>Disabled</t-button>

<!-- Block Button -->
<t-button theme="primary" size="large" block>Block Button</t-button>

<!-- Ghost Button (transparent background) -->
<t-button theme="primary" ghost size="large">Ghost Button</t-button>

Input

json
{
  "usingComponents": {
    "t-input": "tdesign-miniprogram/input/input"
  }
}
html
<t-input
  label="Label"
  placeholder="Please enter"
  value="{{value}}"
  bind:change="onChange"
/>

Dialog

json
{
  "usingComponents": {
    "t-dialog": "tdesign-miniprogram/dialog/dialog"
  }
}
html
<t-dialog
  visible="{{visible}}"
  title="Dialog Title"
  content="Dialog content"
  confirm-btn="Confirm"
  cancel-btn="Cancel"
  bind:confirm="onConfirm"
  bind:cancel="onCancel"
/>

Toast

javascript
import Toast from 'tdesign-miniprogram/toast/index';

Toast({
  context: this,
  selector: '#t-toast',
  message: 'Toast message',
});

AI Chat Interface

json
{
  "usingComponents": {
    "t-chat-list": "tdesign-miniprogram/chat-list/chat-list",
    "t-chat-message": "tdesign-miniprogram/chat-message/chat-message",
    "t-chat-sender": "tdesign-miniprogram/chat-sender/chat-sender"
  }
}
html
<t-chat-list layout="single">
  <t-chat-message
    avatar="{{item.avatar}}"
    name="{{item.name}}"
    content="{{item.content}}"
    role="{{item.role}}"
  />
  <view slot="footer">
    <t-chat-sender bind:send="onSend" />
  </view>
</t-chat-list>
javascript
Component({
  data: {
    messages: [
      {
        role: 'user',
        content: [{ type: 'text', data: 'Hello' }],
      },
      {
        role: 'assistant',
        content: [{ type: 'text', data: 'Hello! How can I help you?' }],
      },
    ],
  },
  methods: {
    onSend(e) {
      const { value } = e.detail;
      // Handle send message
    },
  },
});

Style Customization

Method 1: Using Style Attribute

html
<t-button style="color: red">Custom Style</t-button>
<t-button custom-style="color: red">Custom Style</t-button>

Method 2: Disable Style Isolation

Override styles directly in page:

css
.t-button--primary {
  background-color: navy;
}

In custom components, enable styleIsolation:

javascript
Component({
  options: {
    styleIsolation: 'shared',
  },
});

Method 3: External Style Classes

html
<t-button t-class="my-button-class">Button</t-button>
css
.my-button-class {
  background-color: navy !important;
}

Method 4: CSS Variables

TDesign provides rich CSS variables for theme customization:

css
page {
  --td-button-primary-bg-color: #0052d9;
  --td-button-border-radius: 8rpx;
}

Dark Mode

1. Modify app.json

json
{
  "darkmode": true
}

2. Import Design Token

In app.wxss:

css
@import 'miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss';

3. Use CSS Variables

css
.text {
  color: var(--td-text-color-secondary);
}

4. Special Component Adaptation

For components wrapped in custom-tab-bar or root-portal, add .page class:

html
<view class="page">
  <t-tab-bar />
</view>

Reference Files

This skill includes comprehensive documentation in references/:

Basic Documentation

  • miniprogram/getting-started.md - Quick start guide
  • miniprogram/overview.md - Component overview
  • miniprogram/custom-style.md - Style customization
  • miniprogram/custom-theme.md - Theme customization
  • miniprogram/dark-mode.md - Dark mode

Component Documentation (miniprogram/components/)

  • button.md - Button
  • input.md - Input
  • dialog.md - Dialog
  • form.md - Form
  • ... more component docs

AI Chat Component Documentation (miniprogram-chat/)

  • getting-started.md - Chat component quick start
  • sse.md - SSE streaming
  • components/chat-message.md - Chat message
  • components/chat-sender.md - Chat sender
  • components/chat-list.md - Chat list
  • ... more chat component docs

Use Read tool to access specific reference files when detailed API information is needed.

Key Requirements

  • Minimum base library version: ^2.12.0
  • Build npm in WeChat DevTools required
  • Remove "style": "v2" from app.json

Resources

Notes

  • This skill was automatically generated from TDesign official documentation
  • Reference files preserve the structure and examples from source docs
  • Some reference content remains in Chinese as per official documentation

Matgeliwwert Fichieren

De Modell liest dës Dateie bei Bedarf, wärend de Skill gelueden ass. Si ginn als liesbar Dateie bereetgestallt a ginn ni ausgeféiert.

a weider 16 Fichieren.

Heefeg gestallte Froen

Wat mécht de KI-Skill Tdesign Miniprogram?

TDesign WeChat Mini Program UI component library by Tencent. Use when building WeChat mini apps with TDesign components (Button, Dialog, Input, Tabs, Chat, etc.), implementing TDesign design system, customizing themes/dark mode, or building AI chat interfaces in mini programs.

Firwat Tdesign Miniprogram op TypingMind benotzen?

Well Dir en eemol installéiert a mat all Modell benotze kënnt. Tdesign Miniprogram besteet aus einfachem Markdown amplaz vun ubidderspezifeschem Code. Dee selwechte Skill funktionéiert also mat GPT-5, Claude, Gemini, Grok oder engem lokale Modell – an Dir kënnt de Modell matzen am Chat wiesselen, ouni datt de Skill ophält ze funktionéieren. TypingMind benotzt Är eegen API-Schlësselen, sou datt Dir d'Ubidder direkt bezuelt amplaz vun engem Abonnement pro Benotzerplaz. Är Skills a Chats bleiwen an Ärem eegene Späicher.

Wéi installéieren ech Tdesign Miniprogram an TypingMind?

Maacht an TypingMind Plugins → Skills → Vu GitHub installéieren op a setzt https://github.com/bighardperson/computer-science-skills-collection/tree/main/skills/TDesign%20微信小程序组件 an. TypingMind liest d'Datei SKILL.md, bündelt déi zougehéiereg Dateien an installéiert dat Ganzt als Skill, deen Dir pro Chat aktivéiere kënnt.

Wéi eng KI-Modeller kënnen Tdesign Miniprogram benotzen?

All Modell, deen Dir an TypingMind verbënnt. KI-Skills sinn einfach Markdown-Instruktiounen an net ubidderspezifesche Code. Dofir kënne GPT, Claude, Gemini, Grok a lokal Modeller dëse Skill lueden, wann eng Ufro dozou passt.

Wéi vill KI-Modeller kann ech mat Tdesign Miniprogram benotzen?

Esou vill Dir wëllt. Soulaang e Modell Skills ënnerstëtzt, kënnt Dir Tdesign Miniprogram domat benotzen – GPT, Claude, Gemini, Grok, DeepSeek, Mistral, Llama a méi – alles op TypingMind mat Ären eegenen API-Schlësselen.

Ass de KI-Skill Tdesign Miniprogram gratis?

De Skill gëtt vum bighardperson op GitHub publizéiert. Kuckt am Repository no de Lizenzbedéngungen. Dir bezuelt nëmmen Ären eegene KI-Ubidder fir d'Token, déi Dir benotzt.

Wat si KI-Skills?

E KI-Skill ass e weiderverwendbaart Pak vun Instruktiounen, dat engem KI-Modell bäibréngt, wéi en eng bestëmmt Aufgab erfëllt. E follegt dem oppenen Agent Skills-Format: eng Datei SKILL.md mat engem Numm an enger Beschreiwung, plus all Scripten, Virlagen oder Referenzdateien, déi de Modell eventuell brauch. De Modell liest d'Instruktiounen eréischt, wann Är Ufro zum Skill passt. En installéierte Skill kascht also näischt, bis e benotzt gëtt.

Wéi ënnerscheede sech KI-Skills vu Plugins oder MCP-Serveren?

E Plugin oder MCP-Server gëtt engem Modell nei Tools, déi en opruffe kann – Code, deen iergendwou leeft an e Resultat zeréckgëtt. E KI-Skill gëtt dem Modell dogéint Wëssen an eng Virgoensweis: wéi en eng Aufgab ugeet, wéi eng Schrëtt en nokënnt a wéi eng gutt Ausgab ausgesäit. Skills bestinn aus einfachem Markdown, brauche kee Server, keen API-Schlëssel a keng Lafzäitëmfeld a funktionéiere mat all Modell.

All weisen

Elo Ären eegene KI-Workspace ariichten

Abonnéiert Iech op eisen Newsletter, fir iwwer nei Funktiounen an zukünfteg Gewënnspiller informéiert ze ginn 👇