tdesign-icons-vue provides a comprehensive set of icons specifically designed for Vue 2.x applications, serving as the official icon library within the TDesign enterprise design system. It offers flexibility in usage, allowing developers to import icons as SVG sprite components (Icon), icon font components (IconFont), or individual, tree-shakeable Vue components. The library is actively maintained as part of a mono-repo (`Tencent/tdesign-icons`), with a corresponding `tdesign-icons-vue-next` package available for Vue 3.x projects. The project observes a frequent release cadence, with regular patch and minor updates introducing new icons or optimizations, alongside occasional major version changes that may include icon renames or removals. Its key differentiators include tight integration with the TDesign ecosystem, multiple rendering options, and built-in TypeScript support.
npm install tdesign-icons-vueVerified import paths — ran on the pinned version, not inferred.
Demonstrates how to install and use TDesign icons in a Vue 2 application, showcasing global registration of SVG sprite icons, usage of the IconFont component (with a note about CSS), and direct import of individual icon components.
For Vue 3 projects, install `tdesign-icons-vue-next` (npm i tdesign-icons-vue-next). For Vue 2, ensure `tdesign-icons-vue` is installed.
Always check the CHANGELOG or release notes before upgrading to identify any icon-related breaking changes. Update icon `name` props or imports as necessary.
Include the TDesign icon font CSS in your project (e.g., in `main.js` or `index.html`) if you intend to use `IconFont`. Refer to TDesign's official documentation for the correct path.
Prioritize direct props for sizing and coloring individual icons. For global styling, ensure CSS specificity rules are understood, and consider using CSS variables or scoped styles.
Ensure `import { Icon } from 'tdesign-icons-vue';` is present and the component is registered: `components: { Icon }` or `Vue.component('TIcon', Icon);`.Verify that the icon font CSS file (e.g., from TDesign's main package or a specific icon font distribution) is imported into your main application entry point (e.g., `main.js`) or linked in your `index.html`. For example: `import 'tdesign-vue/es/style/webcomponents.css'` (path may vary).
Double-check the import path for individual icons. If using the general `<Icon>` component, ensure the `name` prop is provided and spelled correctly, matching an existing icon.