BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/blode/ui/circular-progress

Circular Progress

blode-ui/circular-progress
FreeComponent

A circular indicator that shows the progress of a task.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/mblode/blode-ui/main/public/r/circular-progress.json

Source

ui/circular-progress.tsxraw.githubusercontent.com/mblode/blode-ui/main/public/r/circular-progress.json
1"use client";
2
3import type * as React from "react";
4
5import { cn } from "@/lib/utils";
6
7interface CircularProgressProps extends React.ComponentProps<"div"> {
8 hideText?: boolean;
9 strokeWidth?: number;
10 value: number;
11}
12
13const CircularProgress = ({
14 value,
15 strokeWidth = 4,
16 className,
17 hideText,
18 ...props
19}: CircularProgressProps) => {
20 const percentage = Math.min(Math.max(value, 0), 100);
21 const radius = 16;
22 const circumference = 2 * Math.PI * radius;
23 const strokeDashoffset = circumference - (percentage / 100) * circumference;
24
25 return (
26 <div className={cn("relative", className)} {...props}>
27 <progress aria-label="Circular progress" className="sr-only" max={100} value={percentage} />
28 <svg className="size-full -rotate-90" viewBox="0 0 36 36" xmlns="http://www.w3.org/2000/svg">
29 <title>Circular progress</title>
30 <circle
31 className="stroke-current text-primary/30"
32 cx="18"
33 cy="18"
34 fill="none"
35 r={radius}
36 strokeWidth={strokeWidth}
37 />
38 <circle
39 className="stroke-current text-primary"
40 cx="18"
41 cy="18"
42 fill="none"
43 r={radius}
44 strokeDasharray={circumference}
45 strokeDashoffset={strokeDashoffset}
46 strokeLinecap="round"
47 strokeWidth={strokeWidth}
48 style={{
49 transition: "stroke-dashoffset 300ms ease-in-out",
50 }}
51 />
52 </svg>
53
54 {!hideText && (
55 <div className="absolute start-1/2 top-1/2 -translate-x-1/2 -translate-y-1/2 leading-none">
56 <span className="text-center font-bold text-primary leading-none dark:text-foreground">
57 {percentage}%
58 </span>
59 </div>
60 )}
61 </div>
62 );
63};
64
65export { CircularProgress };

Files it writes

  • registry/default/ui/circular-progress.tsx

Facts

Registry
blode/ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-04
Last confirmed
today

Go to the source

blode.co mblode/blode-ui on GitHub Raw registry item This item as JSON

More from blode/ui

All 85 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionblode/uiComponentsFree2 deps
Alertalertblode/uiComponentsFreeno deps
Alert Dialogalert-dialogblode/uiComponentsFree1 dep
Ask User Questionsask-user-questionsblode/uiComponentsFree1 dep
Aspect Ratioaspect-ratioblode/uiComponentsFree1 dep
Attachmentattachmentblode/uiComponentsFree1 dep
Autocompleteautocompleteblode/uiComponentsFree1 dep
Avataravatarblode/uiComponentsFree1 dep
BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex

BlockDex

Built by

Kynth Studio

Index

Components
Registries
Method
Open API

Guides

shadcn component libraries
Best shadcn registries
Free shadcn blocks

Reference

Corpus counts
Crawl health
hello@kynth.studio
Privacy
Terms

BlockDex