Skip to content

Commit

Permalink
fix: icon button component demo
Browse files Browse the repository at this point in the history
  • Loading branch information
jnm2377 committed Mar 22, 2022
1 parent 87d54d0 commit 30aa011
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 21 deletions.
18 changes: 7 additions & 11 deletions src/pages/components/button/code.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ description:
tabs: ['Usage', 'Style', 'Code', 'Accessibility']
---

import { Add16 } from '@carbon/icons-react';

<PageDescription>

Preview the button component with the React live demo. For detailed code usage
Expand Down Expand Up @@ -62,8 +60,10 @@ documentation, see the Storybooks for each framework below.

## Live demo

import { Add } from '@carbon/react/icons';

<ComponentDemo
scope={{ Add16 }}
scope={{ Add }}
components={[
{
id: 'button',
Expand Down Expand Up @@ -113,7 +113,7 @@ documentation, see the Storybooks for each framework below.
'https://web-components.carbondesignsystem.com/?path=/story/components-button--default',
}}
>{`
<Button renderIcon={Add16}>Button</Button>
<Button renderIcon={Add}>Button</Button>
`}</ComponentVariant>
<ComponentVariant
id="icon-only"
Expand All @@ -131,12 +131,8 @@ documentation, see the Storybooks for each framework below.
'https://web-components.carbondesignsystem.com/?path=/story/components-button--icon',
}}
>{`
<Button
hasIconOnly
renderIcon={Add16}
tooltipAlignment="center"
tooltipPosition="bottom"
iconDescription="Button description here"
/>
<IconButton align='top' label='Icon button'>
<Add size={16}/>
</IconButton>
`}</ComponentVariant>
</ComponentDemo>
16 changes: 6 additions & 10 deletions src/pages/components/button/usage.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -80,10 +80,10 @@ actions.

## Live demo

import { Add16 } from '@carbon/icons-react';
import { Add } from '@carbon/react/icons';

<ComponentDemo
scope={{ Add16 }}
scope={{ Add }}
components={[
{
id: 'button',
Expand Down Expand Up @@ -133,7 +133,7 @@ import { Add16 } from '@carbon/icons-react';
'https://web-components.carbondesignsystem.com/?path=/story/components-button--default',
}}
>{`
<Button renderIcon={Add16}>Button</Button>
<Button renderIcon={Add}>Button</Button>
`}</ComponentVariant>
<ComponentVariant
id="icon-only"
Expand All @@ -151,13 +151,9 @@ import { Add16 } from '@carbon/icons-react';
'https://web-components.carbondesignsystem.com/?path=/story/components-button--icon',
}}
>{`
<Button
hasIconOnly
renderIcon={Add16}
tooltipAlignment="center"
tooltipPosition="bottom"
iconDescription="Button description here"
/>
<IconButton align='top' label='Icon button'>
<Add size={16}/>
</IconButton>
`}</ComponentVariant>
</ComponentDemo>

Expand Down

0 comments on commit 30aa011

Please sign in to comment.