-
Notifications
You must be signed in to change notification settings - Fork 11
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Document passing of custom components as icons
- Loading branch information
Showing
3 changed files
with
49 additions
and
1 deletion.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,28 @@ | ||
import { Canvas, Meta, Story } from "@storybook/addon-docs"; | ||
import * as iconStories from "../5-components/Brand/AuIcon.stories"; | ||
|
||
<Meta title="Utilities/Icons" /> | ||
|
||
# Icons | ||
|
||
Appuniversum includes many SVG icons that can be used by passing the name of the icon into the component, e.g. | ||
|
||
``` | ||
<AuButton @icon="book">Button Text</AuButton> | ||
``` | ||
|
||
Alternatively, wherever you can pass an icon name you can instead pass an Ember component that will be rendered instead of the default SVG in the AuIcon component. | ||
This can be used, for example, to use inline SVGs or PNG icons. | ||
|
||
Although the Ember component will not be passed any arguments, it's possible to pass them using the `component` helper. | ||
See [AuIcon docs](/docs/components-brand-auicon--with-custom-icon) for a live example. | ||
|
||
``` | ||
<AuButton @icon={{component 'custom-icon' iconName='some-name'}}>Button Text</AuButton> | ||
``` | ||
|
||
All the available icons are listed here: | ||
|
||
<Canvas> | ||
<Story story={iconStories.Icons} /> | ||
</Canvas> |
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