Skip to content

在网页中使用 Lucide

🌐 Use Lucide in Web

不建议用于高流量生产环境

这个库将每个 SVG 导出为基本字符串。我们有一个针对网页更优化的库。它体积更小,并支持颜色、大小和描边宽度。请参见 Lucide

你还可以在你的网页项目中使用 lucide-static 包导入 SVG 字符串。每个图标都被导出为包含 SVG 标记的字符串,可用于客户端渲染。

🌐 You can also import SVG strings in your web projects, with the lucide-static package. Each icon is exported as a string containing the SVG markup, which can be used in client-side rendering.

<!DOCTYPE html>
<html>
  <body>
    <div id="app"></div>

    <script src="index.js"></script>
  </body>
</html>

注意:每个图标名称都是 PascalCase。你可以在 Lucide 图标页面 找到图标名称。