-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathTextArea.stories.tsx
More file actions
38 lines (34 loc) · 955 Bytes
/
TextArea.stories.tsx
File metadata and controls
38 lines (34 loc) · 955 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
import { useState } from 'react';
import type { Meta, StoryObj } from '@storybook/react';
import { TextArea } from '.';
const meta = {
title: 'components/TextArea',
component: TextArea,
tags: ['autodocs'],
parameters: {
docs: {
description: {
component:
'TextArea 컴포넌트는 사용자가 여러 줄의 텍스트를 입력할 수 있는 필드를 제공합니다.',
},
},
},
} satisfies Meta<typeof TextArea>;
export default meta;
type Story = StoryObj<typeof TextArea>;
export const Basic: Story = {
args: {
value: '',
maxLength: 500,
showCounter: true,
},
render: (args) => {
const [value, setValue] = useState(args.value);
const handleChange = (e: React.ChangeEvent<HTMLTextAreaElement>) => {
setValue(e.target.value);
};
return (
<TextArea {...args} value={value} onChange={handleChange} placeholder="텍스트를 입력하세요" />
);
},
};