Loading...
Loading...
TDesign Mini Program UI component library by Tencent. Use for building WeChat mini apps with TDesign components, design system, and best practices.
npx skill4agent add joneqian/claude-skills-suite tdesign-miniprogramnpm i tdesign-miniprogram -S --production"style": "v2"app.jsonsettingproject.config.json{
"setting": {
"packNpmManually": true,
"packNpmRelationList": [
{
"packageJsonPath": "./package.json",
"miniprogramNpmDistDir": "./"
}
]
}
}{
"paths": {
"tdesign-miniprogram/*": [
"./miniprogram/miniprogram_npm/tdesign-miniprogram/*"
]
}
}After modifying project.config.json, build npm in WeChat DevTools:Tools - Build npm
After successful build, checkCompile JS to ES5
{
"usingComponents": {
"t-button": "tdesign-miniprogram/button/button"
}
}<t-button theme="primary">Button</t-button>| Component | Description | Import Path |
|---|---|---|
| Button | Button | |
| Divider | Divider | |
| Fab | Floating Action Button | |
| Icon | Icon | |
| Layout | Layout | |
| Link | Link | |
| Component | Description | Import Path |
|---|---|---|
| BackTop | Back to Top | |
| Drawer | Drawer | |
| Indexes | Index List | |
| Navbar | Navigation Bar | |
| SideBar | Side Navigation | |
| Steps | Steps | |
| TabBar | Bottom Tab Bar | |
| Tabs | Tabs | |
| Component | Description | Import Path |
|---|---|---|
| Calendar | Calendar | |
| Cascader | Cascader | |
| CheckBox | Checkbox | |
| DateTimePicker | Date Time Picker | |
| Input | Input | |
| Picker | Picker | |
| Radio | Radio | |
| Rate | Rate | |
| Search | Search | |
| Slider | Slider | |
| Stepper | Stepper | |
| Switch | Switch | |
| Textarea | Textarea | |
| TreeSelect | Tree Select | |
| Upload | Upload | |
| Form | Form | |
| Component | Description | Import Path |
|---|---|---|
| Avatar | Avatar | |
| Badge | Badge | |
| Cell | Cell | |
| Collapse | Collapse | |
| CountDown | Countdown | |
| Empty | Empty State | |
| Footer | Footer | |
| Grid | Grid | |
| Image | Image | |
| ImageViewer | Image Viewer | |
| Progress | Progress | |
| Result | Result | |
| Skeleton | Skeleton | |
| Sticky | Sticky | |
| Swiper | Swiper | |
| Table | Table | |
| Tag | Tag | |
| List | List | |
| Component | Description | Import Path |
|---|---|---|
| ActionSheet | Action Sheet | |
| Dialog | Dialog | |
| DropdownMenu | Dropdown Menu | |
| Guide | Guide | |
| Loading | Loading | |
| Message | Message | |
| NoticeBar | Notice Bar | |
| Overlay | Overlay | |
| Popup | Popup | |
| PullDownRefresh | Pull Down Refresh | |
| SwipeCell | Swipe Cell | |
| Toast | Toast | |
| Component | Description | Import Path |
|---|---|---|
| ChatList | Chat List | |
| ChatMessage | Chat Message | |
| ChatSender | Chat Sender | |
| ChatContent | Chat Content | |
| ChatActionbar | Chat Action Bar | |
| ChatLoading | Chat Loading | |
| ChatMarkdown | Chat Markdown | |
| ChatThinking | Chat Thinking | |
| Attachments | Attachments | |
<!-- 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>{
"usingComponents": {
"t-input": "tdesign-miniprogram/input/input"
}
}<t-input
label="Label"
placeholder="Please enter"
value="{{value}}"
bind:change="onChange"
/>{
"usingComponents": {
"t-dialog": "tdesign-miniprogram/dialog/dialog"
}
}<t-dialog
visible="{{visible}}"
title="Dialog Title"
content="Dialog content"
confirm-btn="Confirm"
cancel-btn="Cancel"
bind:confirm="onConfirm"
bind:cancel="onCancel"
/>import Toast from 'tdesign-miniprogram/toast/index';
Toast({
context: this,
selector: '#t-toast',
message: 'Toast message',
});{
"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"
}
}<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>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
},
},
});<t-button style="color: red">Custom Style</t-button>
<t-button custom-style="color: red">Custom Style</t-button>.t-button--primary {
background-color: navy;
}styleIsolationComponent({
options: {
styleIsolation: 'shared',
},
});<t-button t-class="my-button-class">Button</t-button>.my-button-class {
background-color: navy !important;
}page {
--td-button-primary-bg-color: #0052d9;
--td-button-border-radius: 8rpx;
}{
"darkmode": true
}app.wxss@import 'miniprogram_npm/tdesign-miniprogram/common/style/theme/_index.wxss';.text {
color: var(--td-text-color-secondary);
}custom-tab-barroot-portal.page<view class="page">
<t-tab-bar />
</view>references/Read^2.12.0"style": "v2"app.json