Skip to content

Commit 37c8648

Browse files
committed
feat: tag 컴포넌트 스토리북 추가
1 parent 51db87a commit 37c8648

File tree

2 files changed

+63
-0
lines changed

2 files changed

+63
-0
lines changed

src/components/ui/Tag/Tag.module.scss

Lines changed: 19 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -25,3 +25,22 @@
2525
fill: var(--color-gray500);
2626
}
2727
}
28+
29+
.TagStory {
30+
display: flex;
31+
flex-direction: column;
32+
gap: 1rem;
33+
34+
.Wrapper {
35+
display: flex;
36+
gap: 1rem;
37+
justify-content: center;
38+
align-items: center;
39+
width: 300px;
40+
}
41+
42+
.Text {
43+
font-size: 1.125rem;
44+
width: 120px;
45+
}
46+
}
Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
import Tag from "@/components/ui/Tag/Tag";
2+
import styles from "@/components/ui/Tag/Tag.module.scss";
3+
import type { TagProps } from "@/components/ui/Tag/Tag.types";
4+
5+
import type { Meta, StoryObj } from "@storybook/react";
6+
7+
const meta: Meta<typeof Tag> = {
8+
title: "Example/Tag",
9+
component: Tag,
10+
parameters: {
11+
layout: "centered",
12+
},
13+
tags: ["!autodocs"],
14+
};
15+
16+
export default meta;
17+
18+
export const Primary: StoryObj<TagProps> = {
19+
args: {
20+
text: "태그",
21+
variant: "primary",
22+
isSelect: false,
23+
},
24+
};
25+
26+
export const VariantProps: StoryObj<typeof Tag> = {
27+
render: () => (
28+
<div className={styles.TagStory}>
29+
<div className={styles.Wrapper}>
30+
<p className={styles.Text}>primary</p>
31+
<Tag variant="primary" text="primary" />
32+
</div>
33+
<div className={styles.Wrapper}>
34+
<p className={styles.Text}>add</p>
35+
36+
<Tag variant="add" text="add" />
37+
</div>
38+
<div className={styles.Wrapper}>
39+
<p className={styles.Text}>isSelect</p>
40+
<Tag variant="primary" text="isSelect" isSelect />
41+
</div>
42+
</div>
43+
),
44+
};

0 commit comments

Comments
 (0)