import type { Meta, StoryObj } from '@storybook/nextjs'
import { useState } from 'react'
import ProgressCircle from './progress-circle'
const ProgressCircleDemo = ({
initialPercentage = 42,
size = 24,
}: {
initialPercentage?: number
size?: number
}) => {
const [percentage, setPercentage] = useState(initialPercentage)
return (
Upload progress
{percentage}%
ProgressCircle renders a deterministic SVG slice. Advance the slider to preview how the arc grows for upload indicators.
)
}
const meta = {
title: 'Base/Feedback/ProgressCircle',
component: ProgressCircleDemo,
parameters: {
layout: 'centered',
docs: {
description: {
component: 'Compact radial progress indicator wired to upload flows. The story provides a slider to scrub through percentages.',
},
},
},
argTypes: {
initialPercentage: {
control: { type: 'range', min: 0, max: 100, step: 1 },
},
size: {
control: { type: 'number', min: 12, max: 48, step: 2 },
},
},
args: {
initialPercentage: 42,
size: 24,
},
tags: ['autodocs'],
} satisfies Meta
export default meta
type Story = StoryObj
export const Playground: Story = {}
export const NearComplete: Story = {
args: {
initialPercentage: 92,
},
}