> For clean Markdown content of this page, append .md to this URL. For the complete documentation index, see https://buildwithfern.com/learn/llms.txt.

## Card 和 Icon 组件中的自定义 SVG 图标

Card 和 Icon 组件支持 SVG 文件的相对路径。使用像 `./images/icon.svg` 这样的相对路径来显示项目中的自定义 SVG 图标。路径相对于使用组件的页面。

**`Markdown`**

```jsx Markdown
<Card 
    title="蕨类物种" 
    icon="./images/fern-leaf.svg"
>
    带有自定义 SVG 图标的卡片。
</Card>

<Icon icon="./images/fern-leaf.svg" /> 自定义 SVG 图标
```

阅读文档