You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Nidhi Kumari
7424e98416
|
2 years ago | |
---|---|---|
.. | ||
README.mdx | 2 years ago | |
icon-with-fallback.component.js | 3 years ago | |
icon-with-fallback.scss | 3 years ago | |
icon-with-fallback.stories.js | 3 years ago | |
icon-with-fallback.test.js | 3 years ago | |
index.js | 4 years ago |
README.mdx
import { Story, Canvas, ArgsTable } from '@storybook/addon-docs';
import IconWithFallback from '.';
# IconWithFallback
Icon component that takes an image src and uses `onError` to fallback to the first letter of the icon `name`
<Canvas>
<Story id="ui-components-ui-icon-with-fallback-icon-with-fallback-stories-js--default-story" />
</Canvas>
## Props
<ArgsTable of={IconWithFallback} />
## Usage
The following describes the props and example usage for this component.
### Fallback
If the image src errors `onError` the image tag will be replace with a span and the first letter of the `name` prop
<Canvas>
<Story id="ui-components-ui-icon-with-fallback-icon-with-fallback-stories-js--fallback" />
</Canvas>