Press n or j to go to the next uncovered block, b, p or k for the previous block.
| 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 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 | import type { Meta, StoryObj } from '@storybook/react';
import { Progress } from './Progress';
const meta = {
title: 'UI/Progress',
component: Progress,
parameters: {
layout: 'centered',
},
tags: ['autodocs'],
argTypes: {
value: {
control: { type: 'range', min: 0, max: 100, step: 1 },
},
},
} satisfies Meta<typeof Progress>;
export default meta;
type Story = StoryObj<typeof meta>;
export const Default: Story = {
args: {
value: 50,
className: 'w-64',
},
};
export const Zero: Story = {
args: {
value: 0,
className: 'w-64',
},
};
export const Complete: Story = {
args: {
value: 100,
className: 'w-64',
},
};
export const Loading: Story = {
args: {
value: 33,
className: 'w-64',
},
};
export const MultipleProgress: Story = {
render: () => (
<div className="w-64 space-y-4">
<div>
<div className="flex justify-between text-sm mb-1">
<span>Server Load</span>
<span>45%</span>
</div>
<Progress value={45} />
</div>
<div>
<div className="flex justify-between text-sm mb-1">
<span>Memory Usage</span>
<span>72%</span>
</div>
<Progress value={72} />
</div>
<div>
<div className="flex justify-between text-sm mb-1">
<span>Disk Space</span>
<span>91%</span>
</div>
<Progress value={91} />
</div>
</div>
),
}; |