Progress
The thin linear progress bar.
SwiftUI: ProgressView(value:)
Installation
npx shadcn@latest add https://cupertino-ui.baltoon.jp/r/progress.jsonRequires the theme tokens — see Installation if this is your first component.
Source
"use client";
import * as React from "react";
import { Progress as ProgressPrimitive } from "radix-ui";
import { cn } from "@/lib/utils";
/** SwiftUI ProgressView(value:) — the thin linear bar. */
function Progress({
className,
value,
...props
}: React.ComponentProps<typeof ProgressPrimitive.Root>) {
return (
<ProgressPrimitive.Root
data-slot="progress"
className={cn(
"relative h-1 w-full overflow-hidden rounded-full bg-fill",
className
)}
{...props}
>
<ProgressPrimitive.Indicator
data-slot="progress-indicator"
className="size-full flex-1 rounded-full bg-blue transition-transform duration-500 ease-[var(--ease-out-expo)]"
style={{ transform: `translateX(-${100 - (value || 0)}%)` }}
/>
</ProgressPrimitive.Root>
);
}
export { Progress };