-
Notifications
You must be signed in to change notification settings - Fork 2.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Overhaul v8 icon doc text and add search for SVG icons (#21211)
- Loading branch information
1 parent
7d40205
commit d2fbf6b
Showing
18 changed files
with
234 additions
and
89 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
154 changes: 115 additions & 39 deletions
154
apps/public-docsite/src/components/IconGrid/IconGrid.tsx
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
4 changes: 2 additions & 2 deletions
4
...public-docsite/src/pages/Styles/FabricIconsPage/docs/web/FabricIconsOverview.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,7 +1,7 @@ | ||
Fluent UI uses a custom font for its iconography. This font contains glyphs that you can scale, color, and style in any way. There are also mirrored icons available for right-to-left localization. You can also download and install the icon font to use it with various design apps like Sketch, Figma, or Adobe XD. | ||
Fluent UI primarily uses a custom font for its iconography, released under the [Microsoft Fabric Assets License](https://aka.ms/fluentui-assets-license). As of Fluent UI React version 8, an SVG-based version of the same icon set is available under the MIT license. | ||
|
||
**This page is about the general-use monoline icons. See the [brand icons page](#/styles/web/office-brand-icons) for multi-color product icons and the [file type icons page](#/styles/web/file-type-icons) for document icons.** | ||
|
||
### When should I use Fluent UI icons? | ||
|
||
It is recommended to use Fluent UI icons for command bars, navigation or status indicators. If you need icons to represent Office apps, see the [Office brand icons page](#/styles/web/office-brand-icons) . If you are representing files or digital content, see the [file type icons page](#/styles/web/file-type-icons). | ||
It is recommended to use Fluent UI icons for command bars, navigation or status indicators. If you need icons to represent Office apps, see the [Office brand icons page](#/styles/web/office-brand-icons). If you are representing files or digital content, see the [file type icons page](#/styles/web/file-type-icons). |
29 changes: 29 additions & 0 deletions
29
...public-docsite/src/pages/Styles/FabricIconsPage/docs/web/FabricIconsSvgUsage.md
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,29 @@ | ||
An SVG-based version of Fluent UI's icon set is available from `@fluentui/react-icons-mdl2` and is released under the MIT license. This is the same MDL2 icon set used in the font icons, excluding any branded icons. | ||
|
||
Branded SVG icons are available from `@fluentui/react-icons-mdl2-branded` and are still subject to the [Microsoft Fabric Assets License](https://aka.ms/fluentui-assets-license). | ||
|
||
Both packages contain SVG icons wrapped in React components. This allows you to import and bundle only the icons you need, resulting in smaller download sizes compared to the font-based approach with `initializeIcons`, which downloads all icons by default. | ||
|
||
The SVG icon components are primarily intended to be used directly, rather than registering them globally (via `registerIcons` or `initializeIcons`) and referencing them by name in Fluent UI React's `Icon` component or via `iconProps.name`. For example: | ||
|
||
```tsx | ||
import * as React from 'react'; | ||
import * as ReactDOM from 'react-dom'; | ||
import { ChevronDownIcon } from '@fluentui/react-icons-mdl2'; | ||
|
||
ReactDOM.render(<ChevronDownIcon />, document.body.firstChild); | ||
``` | ||
|
||
If you do need to make SVG icons available to reference by name (for example, in Fluent UI React components which take `iconProps`), this can be done using `registerIcons` as follows: | ||
|
||
```tsx | ||
import { registerIcons } from '@fluentui/react/lib/Styling'; | ||
// Note: This approach works with any SVG icon set, not just @fluentui/react-icons-mdl2 | ||
import { ChevronDownIcon } from '@fluentui/react-icons-mdl2'; | ||
|
||
registerIcons({ | ||
icons: { | ||
ChevronDown: <ChevronDownIcon />, | ||
}, | ||
}); | ||
``` |
Oops, something went wrong.