1.0.0 • Published 4 months ago

@darksnow-ui/progress v1.0.0

Weekly downloads
-
License
MIT
Repository
github
Last release
4 months ago

Progress

Displays an indicator showing the completion progress of a task. Built on top of Radix UI Progress primitive.

Installation

npm install @darksnow-ui/progress

Peer Dependencies

npm install react react-dom

Usage

import { Progress } from "@darksnow-ui/progress"

export function ProgressExample() {
  return <Progress value={60} className="w-full" />
}

Props

PropTypeDefaultDescription
valuenumber-Progress value (0-100)
maxnumber100Maximum value
classNamestring-Additional CSS classes

Examples

Basic Progress

<Progress value={60} />

With Animation

function AnimatedProgress() {
  const [progress, setProgress] = useState(0)

  useEffect(() => {
    const timer = setTimeout(() => setProgress(66), 500)
    return () => clearTimeout(timer)
  }, [])

  return <Progress value={progress} className="w-[60%]" />
}

Different Sizes

<div className="space-y-4">
  <Progress value={60} className="h-1" />
  <Progress value={60} className="h-2" />
  <Progress value={60} className="h-4" />
</div>

Custom Colors

<Progress 
  value={60} 
  className="[&>div]:bg-green-500" 
/>

Accessibility

  • Uses proper ARIA attributes
  • Screen reader accessible
  • Keyboard navigation support

Styling

The Progress component uses these default styles:

  • Background: bg-theme-accent/20
  • Indicator: bg-theme-accent
  • Height: h-2
  • Border radius: rounded-full

Related Components