-
Notifications
You must be signed in to change notification settings - Fork 5
docs: document relative SVG path support for Card and Icon components #2910
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,16 @@ | ||
| ## Custom SVG icons in Card and Icon components | ||
|
|
||
| The Card and Icon components now support relative paths to SVG files. Use a relative path like `./images/icon.svg` to display custom SVG icons from your project. | ||
|
||
|
|
||
| ```jsx Markdown | ||
| <Card | ||
| title="Fern species" | ||
| icon="./images/fern-leaf.svg" | ||
| > | ||
| Card with a custom SVG icon. | ||
| </Card> | ||
|
|
||
| <Icon icon="./images/fern-leaf.svg" /> Custom SVG icon | ||
| ``` | ||
|
|
||
| Learn more about the [Card](/learn/docs/writing-content/components/cards) and [Icon](/learn/docs/writing-content/components/icons) components. | ||
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -69,10 +69,18 @@ The `<Icon>` component displays [Font Awesome](https://fontawesome.com/) icons i | |
| <Icon icon="fa-brands fa-github" /> Brands | ||
| ``` | ||
|
|
||
| ### Custom SVG | ||
|
||
|
|
||
| Use a relative path to display a custom SVG file from your project. | ||
|
|
||
| ```jsx Markdown | ||
| <Icon icon="./images/fern-leaf.svg" /> Custom SVG icon | ||
| ``` | ||
|
|
||
| ## Properties | ||
|
|
||
| <ParamField path="icon" type="string" required={true}> | ||
| Name of the Font Awesome icon (e.g., "heart" or "fa-solid fa-heart") | ||
| A Font Awesome icon name (e.g., "heart" or "fa-solid fa-heart") or a relative path to an SVG file (e.g., "./images/icon.svg") | ||
| </ParamField> | ||
|
|
||
| <ParamField path="color" type="string"> | ||
|
|
||
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
📝 [vale] reported by reviewdog 🐶
[FernStyles.Headings] 'Custom SVG icons in Card and Icon components' should use sentence-style capitalization.