Skip to content

Commit

Permalink
add IconButton stories
Browse files Browse the repository at this point in the history
  • Loading branch information
KhudaDad414 committed Oct 24, 2023
1 parent 6f6bca3 commit 58ce064
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 0 deletions.
20 changes: 20 additions & 0 deletions apps/design-system/src/components/IconButton.stories.tsx
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
import { FunctionComponent } from 'react';
import { Meta } from '@storybook/react';
import { IconButton } from '@asyncapi/studio-ui';
import { AddIcon } from '@asyncapi/studio-ui/icons';


const meta: Meta<typeof IconButton> = {
component: IconButton,
parameters: {
layout: "fullscreen",
backgrounds: {
default: "dark",
},
},
}
export default meta;

export const Default = () => <IconButton icon={AddIcon} />
export const WithText = () => <IconButton icon={AddIcon} text="Click Me" />;
export const WithClickEvent = () => <IconButton icon={AddIcon} onClick={() => alert('Button clicked!')} />
2 changes: 2 additions & 0 deletions apps/design-system/src/design-tokens/Icons.stories.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ import {
UsersIcon,
WebSocketIcon,
XMarkIcon,
AddIcon,
} from '@asyncapi/studio-ui/icons'

<Meta
Expand Down Expand Up @@ -80,6 +81,7 @@ Most of the icons below are taken from https://heroicons.com. If you need to add
UsersIcon,
WebSocketIcon,
XMarkIcon,
AddIcon,
].map((Icon) => (
<IconItem name={Icon.displayName || Icon.render.name}>
<Icon />
Expand Down

0 comments on commit 58ce064

Please sign in to comment.