Branchwell

Become a Pro / website · becomeapro.ai / src / components / ui / progress.tsx

Raw 791 B on 59dac1cc932d622dfc4d6c274a9ed8e9abcc5e5e
1"use client"
2
3import * as React from "react"
4import * as ProgressPrimitive from "@radix-ui/react-progress"
5
6import { cn } from "@/lib/utils"
7
8const Progress = React.forwardRef<
9 React.ElementRef<typeof ProgressPrimitive.Root>,
10 React.ComponentPropsWithoutRef<typeof ProgressPrimitive.Root>
11>(({ className, value, ...props }, ref) => (
12 <ProgressPrimitive.Root
13 ref={ref}
14 className={cn(
15 "relative h-4 w-full overflow-hidden rounded-full bg-secondary",
16 className
17 )}
18 {...props}
19 >
20 <ProgressPrimitive.Indicator
21 className="h-full w-full flex-1 bg-primary transition-all"
22 style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
23 />
24 </ProgressPrimitive.Root>
25))
26Progress.displayName = ProgressPrimitive.Root.displayName
27
28export { Progress }