-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAvatar.stories.tsx
58 lines (53 loc) · 1.23 KB
/
Avatar.stories.tsx
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
import { Meta } from "@storybook/react";
import { StoryObj } from "@storybook/react";
import { Avatar, AvatarFallback, AvatarImage } from "./index";
import React from "react";
const meta = {
title: "UI/Avatar",
component: Avatar,
parameters: {
layout: "centered"
},
decorators: [
(Story) => (
<div className="flex items-center gap-7">
<Story />
</div>
)
],
argTypes: {
size: {
description: "defining the size of the avatar",
control: "select",
defaultValue: "md",
options: ["xs", "sm", "md", "lg", "xl", "xxl"]
},
type: {
description: "defining the type of the avatar",
control: "select",
defaultValue: "rounded",
options: ["rounded", "square"]
}
},
tags: ["autodocs"]
} satisfies Meta<typeof Avatar>;
export default meta;
type Story = StoryObj<typeof meta>;
export const DefaultVariant: Story = {
name: "Default",
args: {
size: "md",
type: "rounded"
},
render: (args) => (
<>
<Avatar size={args.size} type={args.type}>
<AvatarImage src="https://avatar.vercel.sh/randomValue?size=24" />
<AvatarFallback size={args.size}>RV</AvatarFallback>
</Avatar>
<Avatar size={args.size} type={args.type}>
<AvatarFallback size={args.size}>RV</AvatarFallback>
</Avatar>
</>
)
};