Loading...
Loading...
TDesign Vue 3 component library usage guide, covering tdesign-vue-next 1.x series, including basic components, forms, tables, theme customization, dark mode, and AI Chat components
npx skill4agent add yunfeizhu/tdesign-vue-next-skill tdesign-vue-nexttdesign-vue-next@^1<script setup>ConfigProviderConfigProvidertdesign-icons-vue-nextimport { Button } from 'tdesign-vue-next'@ts-ignoreReference| Trigger Condition | Reference |
|---|---|
Dynamic forms ( | |
| Server-side sorting/filtering/pagination, virtual scroll, editable table, tree table | |
| Remote search, large datasets, paginated loading, custom rendering | |
| Controlled file list, resumable upload, custom upload request | |
| Async node loading, checkStrictly, virtual scroll | |
| Async loading, dynamic options, custom panel | |
| Dialog/Drawer nesting, imperative calls, close interception | |
| Deep theme customization, dynamic theme switching, component-level style override | |
| Dark mode toggle, system preference sync, local dark mode | |
| AI chat component, streaming response, custom message rendering | |
| TDesign Vue Next 1.x version differences, upgrade guide | |
Reference| Topic | Description | |
|---|---|---|
| Version Reference | 1.x version scope, upgrade notes | |
| Form Advanced | Dynamic forms, linked validation, async validation | |
| Table Advanced | Virtual scroll, server-side data, editable cells | |
| Select Advanced | Remote search, pagination, custom options | |
| Upload Advanced | Controlled upload, custom request, resumable upload | |
| Tree Advanced | Async loading, checkStrictly, virtual scroll | |
| Cascader Advanced | Async loading, dynamic panel | |
| Dialog/Drawer Advanced | Nested layers, imperative calls | |
| Theme Customization | CSS variables, Design Token, dynamic theme | |
| Dark Mode | Mode toggle, system preference, local dark mode | |
| Chat Component | AI chat, streaming response, message rendering | |
User requirements
├── Basic display → Button / Link / Icon / Typography
├── Layout structure → Layout / Grid / Space / Divider
├── Navigation interaction → Menu / Tabs / Breadcrumb / Steps / Pagination
├── Data input → Form / Input / Select / DatePicker / Upload / ...
├── Data display → Table / List / Tree / Card / Descriptions / ...
├── Feedback → Message / Notification / Dialog / Drawer / Loading
└── Advanced scenarios → Chat (AI conversation)ConfigProvider<template>
<ConfigProvider :global-config="globalConfig">
<App />
</ConfigProvider>
</template>
<script setup lang="ts">
import { ConfigProvider } from "tdesign-vue-next";
const globalConfig = {
// Global configuration
};
</script>| Scenario | Recommended Component | Notes |
|---|---|---|
| Simple list display | | Small data, no complex interaction |
| Complex data table | | Supports sorting, filtering, pagination |
| Large data table | | Enable virtual scroll |
| Tree data selection | | Single/multiple tree selection |
| Cascading selection | | Multi-level linked selection |
| Simple dropdown | | Moderate number of options |
| Remote search select | | Disable local filtering |
| File upload | | Supports drag, multi-file |
| Form collection | | Unified validation and submit |
| Light notification | | Operation feedback, auto-dismiss |
| Important notification | | Requires user confirmation or contains actions |
| Confirmation action | | Choose based on context |
| Side panel details | | Without interrupting page flow |
| AI conversation | | Streaming messages, multi-turn dialogue |
Need to collect user input?
├── Yes → Use Form wrapper
│ ├── Need dynamic add/remove fields? → See form-advanced.md
│ ├── Need cross-field linking? → See form-advanced.md
│ └── Simple form → Use FormItem + rules
└── No → Use input component directlyNeed to display list data?
├── Data > 1000 rows? → Enable virtual scroll, see table-advanced.md
├── Need server-side pagination/sorting? → See table-advanced.md
├── Need editable cells? → See table-advanced.md
└── Simple table → Use Table + columns + dataNeed to customize theme?
├── Only modify brand color → ConfigProvider theme prop
├── Modify multiple tokens → Override CSS variables
├── Deep customization → See theming-advanced.md
└── Dark mode → See dark-mode.mdReferencelabeltemplatecomputedkey<script setup>rulestriggermodelrow-keycolumnscomputedfilterable:filterv-model:filesactionrequestMethodkeysloadv-model:visibledestroyOnClosetheme-mode<html>tdesign-icons-vue-nextnpm install tdesign-vue-next
# Icon library
npm install tdesign-icons-vue-next// main.ts
import { createApp } from "vue";
import TDesign from "tdesign-vue-next";
import "tdesign-vue-next/es/style/index.css";
import App from "./App.vue";
createApp(App).use(TDesign).mount("#app");// main.ts
import { createApp } from "vue";
import { Button, Input, Form, FormItem } from "tdesign-vue-next";
import "tdesign-vue-next/es/style/index.css";
import App from "./App.vue";
const app = createApp(App);
app.use(Button).use(Input).use(Form).use(FormItem);
app.mount("#app");<template>
<ConfigProvider>
<Form :model="formData" :rules="rules" @submit="onSubmit">
<FormItem label="Username" name="username">
<Input v-model="formData.username" placeholder="Enter username" />
</FormItem>
<FormItem>
<Button theme="primary" type="submit">Submit</Button>
</FormItem>
</Form>
</ConfigProvider>
</template>
<script setup lang="ts">
import { reactive } from "vue";
import {
ConfigProvider,
Form,
FormItem,
Input,
Button,
} from "tdesign-vue-next";
import type { FormRules, SubmitContext } from "tdesign-vue-next";
const formData = reactive({
username: "",
});
const rules: FormRules<typeof formData> = {
username: [{ required: true, message: "Username is required" }],
};
const onSubmit = ({ validateResult }: SubmitContext) => {
if (validateResult === true) {
console.log("Submit successful", formData);
}
};
</script>