Skip to content

Commit 6c4ae8e

Browse files
committed
[#47] ✅ Add Storybook for Label component
1 parent 0f5fbf0 commit 6c4ae8e

File tree

1 file changed

+45
-0
lines changed

1 file changed

+45
-0
lines changed
Lines changed: 45 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
import { Meta, StoryObj } from '@storybook/react'
2+
3+
import { TextInput } from '@/components/common/input/TextInput'
4+
import { Label } from '@/components/common/label/Label'
5+
import { LabelProps } from '@/components/common/label/Label'
6+
7+
const meta: Meta<typeof Label> = {
8+
title: 'Common/Label/Label',
9+
component: Label,
10+
parameters: {
11+
layout: 'centered',
12+
},
13+
args: {
14+
required: false,
15+
labelText: '라벨 제목',
16+
},
17+
}
18+
19+
export default meta
20+
21+
type Story = StoryObj<typeof Label>
22+
23+
export const Default: Story = {
24+
args: {
25+
labelText: '이름',
26+
required: false,
27+
},
28+
render: (args: LabelProps) => (
29+
<Label {...args}>
30+
<TextInput placeholder='이름을 입력하세요' />
31+
</Label>
32+
),
33+
}
34+
35+
export const RequiredLabel: Story = {
36+
args: {
37+
labelText: '이메일',
38+
required: true,
39+
},
40+
render: (args: LabelProps) => (
41+
<Label {...args}>
42+
<TextInput placeholder='이메일을 입력하세요' />
43+
</Label>
44+
),
45+
}

0 commit comments

Comments
 (0)