Skip to content

Commit 9d69a26

Browse files
committed
feat: 아이콘 버튼 storybook 추가
1 parent 82c22f1 commit 9d69a26

File tree

2 files changed

+68
-0
lines changed

2 files changed

+68
-0
lines changed

src/components/ui/IconButton/IconButton.module.scss

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,3 +21,21 @@
2121
@include buttonTertiary;
2222
}
2323
}
24+
25+
.IconButtonStory {
26+
display: flex;
27+
flex-direction: column;
28+
gap: 1rem;
29+
30+
.Wrapper {
31+
display: flex;
32+
gap: 1rem;
33+
justify-content: center;
34+
align-items: center;
35+
}
36+
37+
.Text {
38+
font-size: 1.125rem;
39+
width: 120px;
40+
}
41+
}
Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
import IconButton from "@/components/ui/IconButton/IconButton";
2+
import styles from "@/components/ui/IconButton/IconButton.module.scss";
3+
import type { IconButtonProps } from "@/components/ui/IconButton/IconButton.types";
4+
5+
import type { Meta, StoryObj } from "@storybook/react";
6+
7+
const meta: Meta<typeof IconButton> = {
8+
title: "Example/IconButton",
9+
component: IconButton,
10+
parameters: {
11+
layout: "centered",
12+
},
13+
tags: ["!autodocs"],
14+
};
15+
16+
export default meta;
17+
18+
export const Primary: StoryObj<IconButtonProps> = {
19+
args: {
20+
text: "갤러리",
21+
iconName: "gallery",
22+
size: "md",
23+
},
24+
};
25+
26+
export const IconNameProps: StoryObj<typeof IconButton> = {
27+
render: () => (
28+
<div className={styles.IconButtonStory}>
29+
<div className={styles.Wrapper}>
30+
<p className={styles.Text}>gallery</p>
31+
<IconButton text="갤러리" iconName="gallery" />
32+
</div>
33+
<div className={styles.Wrapper}>
34+
<p className={styles.Text}>camera</p>
35+
<IconButton text="카메라" iconName="camera" />
36+
</div>
37+
</div>
38+
),
39+
};
40+
41+
export const SizeProps: StoryObj<typeof IconButton> = {
42+
render: () => (
43+
<div className={styles.IconButtonStory}>
44+
<div className={styles.Wrapper}>
45+
<p className={styles.Text}>sm</p>
46+
<IconButton size="sm" text="복사하기" iconName="paste" />
47+
</div>
48+
</div>
49+
),
50+
};

0 commit comments

Comments
 (0)