diff --git a/docs/getting-started/app-custom-theme.md b/docs/getting-started/app-custom-theme.md index da4f10a64b..9ca82d01a1 100644 --- a/docs/getting-started/app-custom-theme.md +++ b/docs/getting-started/app-custom-theme.md @@ -273,6 +273,71 @@ const LogoFull = () => { }; ``` +## Custom Icons + +You can also customize the Project's _default_ icons. + +You can change the following [icons](https://github.com/backstage/backstage/blob/master/packages/app-defaults/src/defaults/icons.tsx). + +### Requirements + +- Files in `.svg` format +- React components created for the icons + +### Create React Component + +In your front-end application, locate the `src` folder. We suggest creating the `assets/icons` directory and `CustomIcons.tsx` file. + +> Another example [here](https://github.com/backstage/backstage/blob/master/plugins/azure-devops/src/components/AzurePipelinesIcon/AzurePipelinesIcon.tsx), if you want to ensure proper behavior in light and dark themes. + +```tsx +// customIcons.tsx +import { SvgIcon, SvgIconProps } from '@material-ui/core'; + +import React from 'react'; + +export const ExampleIcon = (props: SvgIconProps) => ( + + + +); +``` + +### Using the custom icon + +Supply your custom icon in `packages/app/src/App.tsx` + +```diff + ++ import { ExampleIcon } from './assets/customIcons' + +[...] + +const app = createApp({ + apis, + components: { + [...] + }, + themes: [ + [...] + ], ++ icons: { ++ github: ExampleIcon, ++ }, + bindRoutes({ bind }) { + [...] + } +}) + +[...] +``` + ## Custom Homepage In addition to a custom theme, a custom logo, you can also customize the