Appearance
入门
🌐 Getting started
本指南将帮助你在项目中开始使用 Lucide Static。确保你的环境已设置好。如果你还没有环境,可以使用 Vite、Parcel 或你选择的任何其他模板创建一个新项目。
🌐 This guide will help you get started with Lucide Static in your project. Make sure you have a your environment set up. If you don't have one yet, you can create a new project using Vite, Parcel or any other boilerplate of your choice.
lucide-static适用于哪些用例?
🌐 For what use cases is lucide-static suitable?
lucide-static 适用于 非常特定的使用场景,在这些场景中你希望使用 Lucide 图标而不依赖于 JavaScript 框架或组件系统。它非常适合用于:
- 将图标字体与纯 CSS 或实用优先框架结合使用的项目
- 将原始 SVG 文件或精灵图直接嵌入 HTML
- 使用 SVG 作为 CSS 背景图片
- 将 SVG 字符串导入 Node.js 环境
不推荐用于生产高性能需求
SVG 精灵和图标字体包含所有图标,这可能会显著增加你应用的包大小和加载时间。
对于生产环境,我们建议使用支持 tree-shaking 的打包工具,只包含你实际使用的图标。可以考虑使用其中一个特定框架的 包。
🌐 For production environments, we recommend using a bundler with tree-shaking support to include only the icons you actually use. Consider using one of the framework-specific packages.
安装
🌐 Installation
软件包管理器
🌐 Package Managers
sh
pnpm add lucide-staticsh
yarn add lucide-staticsh
npm install lucide-staticsh
bun add lucide-static