Files
shadcn-ui/apps/v4/examples/radix/ui/progress.tsx
shadcn 62aef1117f fix
2026-01-08 21:27:27 +04:00

31 lines
760 B
TypeScript

"use client"
import * as React from "react"
import { cn } from "@/examples/radix/lib/utils"
import { Progress as ProgressPrimitive } from "radix-ui"
function Progress({
className,
value,
...props
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
return (
<ProgressPrimitive.Root
data-slot="progress"
className={cn(
"bg-muted relative flex h-1 w-full items-center overflow-x-hidden rounded-full",
className
)}
{...props}
>
<ProgressPrimitive.Indicator
data-slot="progress-indicator"
className="bg-primary size-full flex-1 transition-all"
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
)
}
export { Progress }