Progress
optics/progressFreeComponent
Displays an indicator showing the completion progress of a task.
See it running
Open the demo on optics
optics.agusmayol.com.ar/components/progressInstall it
npx shadcn@latest add https://optics.agusmayol.com.ar/r/progress.jsonSource
1"use client";23import { Progress as ProgressPrimitive } from "@base-ui/react/progress";45import { cn } from "@/lib/utils";67function Progress({ className = "", children = null, value = 0, ...props }) {8 return (9 <ProgressPrimitive.Root10 value={value}11 data-slot="progress"12 className={cn("flex flex-wrap gap-3", className)}13 {...props}14 >15 {children}16 <ProgressTrack>17 <ProgressIndicator />18 </ProgressTrack>19 </ProgressPrimitive.Root>20 );21}2223function ProgressTrack({ className = "", ...props }) {24 return (25 <ProgressPrimitive.Track26 className={cn(27 "bg-muted h-1 rounded-md relative flex w-full items-center overflow-x-hidden",28 className,29 )}30 data-slot="progress-track"31 {...props}32 />33 );34}3536function ProgressIndicator({ className = "", ...props }) {37 return (38 <ProgressPrimitive.Indicator39 data-slot="progress-indicator"40 className={cn("bg-primary h-full transition-all", className)}41 {...props}42 />43 );44}4546function ProgressLabel({ className = "", ...props }) {47 return (48 <ProgressPrimitive.Label49 className={cn("text-xs/relaxed font-medium", className)}50 data-slot="progress-label"51 {...props}52 />53 );54}5556function ProgressValue({ className = "", ...props }) {57 return (58 <ProgressPrimitive.Value59 className={cn(60 "text-muted-foreground ml-auto text-xs/relaxed tabular-nums",61 className,62 )}63 data-slot="progress-value"64 {...props}65 />66 );67}6869Progress.displayName = "Progress";70ProgressTrack.displayName = "ProgressTrack";71ProgressIndicator.displayName = "ProgressIndicator";72ProgressLabel.displayName = "ProgressLabel";73ProgressValue.displayName = "ProgressValue";7475export {76 Progress,77 ProgressTrack,78 ProgressIndicator,79 ProgressLabel,80 ProgressValue,81};
What it pulls in
npm packages
Other registry items
Files it writes
More from optics
All 79 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | optics | Components | Free | 5 deps | |
| Alertalert | optics | Components | Free | 4 deps | |
| Alert Dialogalert-dialog | optics | Components | Free | 4 deps | |
| Aspect Ratioaspect-ratio | optics | Components | Free | 2 deps | |
| Auto Heightauto-height | optics | Components | Free | 3 deps | |
| Avataravatar | optics | Components | Free | 3 deps | |
| Badgebadge | optics | Components | Free | 4 deps | |
| Breadcrumbbreadcrumb | optics | Components | Free | 4 deps |
