Progress
basecn/progressFreeComponent
Displays an indicator showing the completion progress of a task, typically displayed as a progress bar.
Live preview
live · rendered by the registry
Rendered by basecn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://basecn.dev/r/progress.jsonSource
1"use client";23import { Progress as ProgressPrimitive } from "@base-ui/react/progress";4import * as React from "react";56import { cn } from "@/lib/utils";78function Progress({9 className,10 children,11 ...props12}: ProgressPrimitive.Root.Props) {13 return (14 <ProgressPrimitive.Root15 data-slot="progress"16 className={cn("relative w-full", className)}17 {...props}18 >19 {children ? (20 children21 ) : (22 <ProgressTrack>23 <ProgressIndicator />24 </ProgressTrack>25 )}26 </ProgressPrimitive.Root>27 );28}2930function ProgressTrack({ className, ...props }: ProgressPrimitive.Track.Props) {31 return (32 <ProgressPrimitive.Track33 data-slot="progress-track"34 className={cn(35 "bg-primary/20 w-full h-2 overflow-hidden rounded-full",36 className37 )}38 {...props}39 />40 );41}4243function ProgressIndicator({44 className,45 ...props46}: ProgressPrimitive.Indicator.Props) {47 return (48 <ProgressPrimitive.Indicator49 data-slot="progress-indicator"50 className={cn(51 "bg-primary h-full w-full flex-1 transition-all",52 className53 )}54 {...props}55 />56 );57}5859function ProgressLabel({ className, ...props }: ProgressPrimitive.Label.Props) {60 return (61 <ProgressPrimitive.Label62 data-slot="progress-label"63 className={cn("text-sm text-muted-foreground", className)}64 {...props}65 />66 );67}6869function ProgressValue({ className, ...props }: ProgressPrimitive.Value.Props) {70 return (71 <ProgressPrimitive.Value72 data-slot="progress-value"73 className={cn("text-sm text-muted-foreground", className)}74 {...props}75 />76 );77}7879export {80 Progress,81 ProgressIndicator,82 ProgressLabel,83 ProgressTrack,84 ProgressValue,85};
What it pulls in
npm packages
Files it writes
More from basecn
All 56 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Accordionaccordion | basecn | Components | Free | 2 deps | |
| Alertalert | basecn | Components | Free | 1 dep | |
| Alert Dialogalert-dialog | basecn | Components | Free | 1 dep | |
| Aspect Ratioaspect-ratio | basecn | Components | Free | no deps | |
| Autocompleteautocomplete | basecn | Components | Free | 2 deps | |
| Avataravatar | basecn | Components | Free | 1 dep | |
| Badgebadge | basecn | Components | Free | 2 deps | |
| Breadcrumbbreadcrumb | basecn | Components | Free | 2 deps |
