Skip to content

Commit 9cdb486

Browse files
committed
[#51] ✅ add Avatar stories
1 parent 8c43bae commit 9cdb486

File tree

1 file changed

+64
-0
lines changed

1 file changed

+64
-0
lines changed
Lines changed: 64 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,64 @@
1+
import { Meta, StoryObj } from '@storybook/react'
2+
3+
import { Avatar } from '@/components/common/avatar'
4+
5+
const meta: Meta<typeof Avatar> = {
6+
title: 'Common/Avatar/Avatar',
7+
component: Avatar,
8+
parameters: {
9+
layout: 'centered',
10+
},
11+
argTypes: {
12+
size: {
13+
control: 'select',
14+
options: [24, 48, 60, 180],
15+
description: 'Avatar size in pixels',
16+
},
17+
image: {
18+
control: 'text',
19+
description: 'URL of the avatar image',
20+
},
21+
alt: {
22+
control: 'text',
23+
description: 'Alt text for the avatar image',
24+
},
25+
className: {
26+
control: 'text',
27+
description: 'Additional CSS classes for custom styling',
28+
},
29+
},
30+
args: {
31+
alt: 'User Avatar',
32+
},
33+
}
34+
35+
export default meta
36+
type Story = StoryObj<typeof Avatar>
37+
38+
export const Default: Story = {
39+
args: {
40+
size: 48,
41+
image: null,
42+
},
43+
}
44+
45+
export const WithImage: Story = {
46+
args: {
47+
size: 48,
48+
image: 'https://picsum.photos/250/250',
49+
},
50+
}
51+
52+
export const LargeAvatar: Story = {
53+
args: {
54+
size: 180,
55+
image: 'https://picsum.photos/250/250',
56+
},
57+
}
58+
59+
export const SmallAvatar: Story = {
60+
args: {
61+
size: 24,
62+
image: null,
63+
},
64+
}

0 commit comments

Comments
 (0)