Feature/docs (#67)
This commit is contained in:
committed by
GitHub
parent
7a1ec55a5c
commit
81ca566b5e
27
website/content/docs/custom-icons.mdx
Normal file
27
website/content/docs/custom-icons.mdx
Normal file
@ -0,0 +1,27 @@
|
||||
---
|
||||
group: Customization
|
||||
title: Adding Custom Icons
|
||||
weight: 100
|
||||
---
|
||||
|
||||
The Static CMS exposes a `window.CMS` global object that you can use to register custom icons via `registerIcon`. The same object is also the default export if you import Static CMS as an npm module.
|
||||
|
||||
Custom icons can be used with [Collections](/docs/collection-overview) or [Custom Links & Pages](/docs/additional-links)
|
||||
|
||||
## Params
|
||||
|
||||
| Param | Type | Description |
|
||||
| ----- | ------------------------------------------------------------------------------ | -------------------------------------------------- |
|
||||
| name | string | A unique name for the icon |
|
||||
| name | [React Function Component](https://reactjs.org/docs/components-and-props.html) | A React functional component that renders the icon |
|
||||
|
||||
## Example
|
||||
|
||||
This example uses Font Awesome to supply the icon.
|
||||
|
||||
```js
|
||||
import { faHouse } from '@fortawesome/free-solid-svg-icons';
|
||||
import { FontAwesomeIcon } from '@fortawesome/react-fontawesome';
|
||||
|
||||
cmsApp.registerIcon('house', <FontAwesomeIcon icon={faHouse} size="lg" />);
|
||||
```
|
Reference in New Issue
Block a user