BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/solid-ui/progress-circle

Progress Circle

solid-ui/progress-circle
FreeComponent

A progress circle component

Live preview

live · rendered by the registry
Rendered by solid-ui on their own page — this is the component running, not a screenshot of it.

Install it

npx shadcn@latest add https://www.solid-ui.com/r/progress-circle.json

Source

src/registry/ui/progress-circle.tsxwww.solid-ui.com/r/progress-circle.json
1import type { Component, ComponentProps } from "solid-js"
2import { mergeProps, splitProps } from "solid-js"
3
4import { cn } from "~/lib/utils"
5
6type Size = "xs" | "sm" | "md" | "lg" | "xl"
7
8const sizes: Record<Size, { radius: number; strokeWidth: number }> = {
9 xs: { radius: 15, strokeWidth: 3 },
10 sm: { radius: 19, strokeWidth: 4 },
11 md: { radius: 32, strokeWidth: 6 },
12 lg: { radius: 52, strokeWidth: 8 },
13 xl: { radius: 80, strokeWidth: 10 }
14}
15
16type ProgressCircleProps = ComponentProps<"div"> & {
17 value?: number
18 size?: Size
19 radius?: number
20 strokeWidth?: number
21 showAnimation?: boolean
22}
23
24const ProgressCircle: Component<ProgressCircleProps> = (rawProps) => {
25 const props = mergeProps({ size: "md" as Size, showAnimation: true }, rawProps)
26 const [local, others] = splitProps(props, [
27 "class",
28 "children",
29 "value",
30 "size",
31 "radius",
32 "strokeWidth",
33 "showAnimation"
34 ])
35
36 const value = () => getLimitedValue(local.value)
37 const radius = () => local.radius ?? sizes[local.size].radius
38 const strokeWidth = () => local.strokeWidth ?? sizes[local.size].strokeWidth
39 const normalizedRadius = () => radius() - strokeWidth() / 2
40 const circumference = () => normalizedRadius() * 2 * Math.PI
41 const strokeDashoffset = () => (value() / 100) * circumference()
42 const offset = () => circumference() - strokeDashoffset()
43
44 return (
45 <div class={cn("flex flex-col items-center justify-center", local.class)} {...others}>
46 <svg
47 width={radius() * 2}
48 height={radius() * 2}
49 viewBox={`0 0 ${radius() * 2} ${radius() * 2}`}
50 class="-rotate-90"
51 >
52 <circle
53 r={normalizedRadius()}
54 cx={radius()}
55 cy={radius()}
56 stroke-width={strokeWidth()}
57 fill="transparent"
58 stroke=""
59 stroke-linecap="round"
60 class={cn("stroke-secondary transition-colors ease-linear")}
61 />
62 {value() >= 0 ? (
63 <circle
64 r={normalizedRadius()}
65 cx={radius()}
66 cy={radius()}
67 stroke-width={strokeWidth()}
68 stroke-dasharray={circumference() + " " + circumference()}
69 stroke-dashoffset={offset()}
70 fill="transparent"
71 stroke=""
72 stroke-linecap="round"
73 class={cn(
74 "stroke-primary transition-colors ease-linear",
75 local.showAnimation ? "transition-all duration-300 ease-in-out" : ""
76 )}
77 />
78// … truncated

What it pulls in

npm packages

  • solid-js

Files it writes

  • src/registry/ui/progress-circle.tsx

Facts

Registry
solid-ui
Type
registry:ui
Access
Free
Files written
1
Licence
MIT
First indexed
2026-08-03
Last confirmed
yesterday

Go to the source

Docs on solid-ui www.solid-ui.com stefan-karger/solid-ui on GitHub Raw registry item This item as JSON

More from solid-ui

All 55 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
Accordionaccordionsolid-uiComponentsFree2 deps
Alertalertsolid-uiComponentsFree3 deps
Alert Dialogalert-dialogsolid-uiComponentsFree2 deps
Aspect Ratioaspect-ratiosolid-uiComponentsFree1 dep
Avataravatarsolid-uiComponentsFree2 deps
Badgebadgesolid-uiComponentsFree2 deps
Badge Deltabadge-deltasolid-uiComponentsFree2 deps
Bar Listbar-listsolid-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