Skip to content

Commit d358b85

Browse files
committed
spinner component
1 parent 2bc3a2c commit d358b85

File tree

3 files changed

+39
-1
lines changed

3 files changed

+39
-1
lines changed

.storybook/main.ts

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,6 @@ import path from "path";
66
const config: StorybookConfig = {
77
stories: ["../src/**/*.mdx", "../src/**/*.stories.@(js|jsx|mjs|ts|tsx)"],
88
addons: [
9-
"@storybook/addon-onboarding",
109
"@storybook/addon-links",
1110
"@storybook/addon-essentials",
1211
"@chromatic-com/storybook",
Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
import { Meta, StoryObj } from '@storybook/react';
2+
import Spinner, { SpinnerProps } from './Spinner';
3+
4+
const meta: Meta<typeof Spinner> = {
5+
title: 'Components/Atoms/Spinner',
6+
component: Spinner,
7+
parameters: {
8+
layout: 'centered',
9+
},
10+
};
11+
12+
export default meta;
13+
14+
type SpinnerStory = StoryObj<SpinnerProps>;
15+
16+
export const Small: SpinnerStory = {
17+
render: (args) => <Spinner {...args} className="w-4 h-4" />
18+
};
19+
export const Medium: SpinnerStory = {
20+
render: (args) => <Spinner {...args} className="w-8 h-8" />
21+
};
22+
export const Large: SpinnerStory = {
23+
render: (args) => <Spinner {...args} className="w-12 h-12" />
24+
};
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
import { cn } from "../../../utils";
2+
3+
export type SpinnerProps = {
4+
className?: string;
5+
};
6+
7+
const Spinner = ({ className }: SpinnerProps) => {
8+
return (
9+
<div
10+
className={cn('border-4 border-solid border-blue-500 border-t-transparent rounded-full animate-spin', className)}
11+
></div>
12+
);
13+
};
14+
15+
export default Spinner;

0 commit comments

Comments
 (0)