Progress Ring
scificn/progress-ringFreeComponent
SVG circular gauge with glow arc. Complements the linear Progress bar. Variants: DEFAULT, ACTIVE, WARNING, CRITICAL.
Live preview
live · rendered by the registry
Rendered by scificn on their own page — this is the component running, not a screenshot of it.Install it
npx shadcn@latest add https://www.scificn.dev/r/progress-ring.jsonSource
1import * as React from 'react'2import { cn } from '@/lib/utils'34export type ProgressRingVariant = 'DEFAULT' | 'ACTIVE' | 'WARNING' | 'CRITICAL'56export interface ProgressRingProps extends React.HTMLAttributes<HTMLDivElement> {7 value: number8 size?: number9 strokeWidth?: number10 label?: string11 showValue?: boolean12 variant?: ProgressRingVariant13}1415const ProgressRing = React.forwardRef<HTMLDivElement, ProgressRingProps>(16 (17 {18 className,19 value = 0,20 size = 120,21 strokeWidth = 6,22 label,23 showValue = true,24 variant = 'DEFAULT',25 style,26 ...props27 },28 ref29 ) => {30 const pct = Math.min(Math.max(value, 0), 100)31 const cx = size / 232 const cy = size / 233 const r = (size - strokeWidth) / 234 const circ = 2 * Math.PI * r35 const offset = circ * (1 - pct / 100)3637 const accentColor =38 variant === 'ACTIVE' ? 'var(--color-green)' :39 variant === 'WARNING' ? 'var(--color-amber)' :40 variant === 'CRITICAL' ? 'var(--color-red)' :41 'var(--text-secondary)'4243 const textGlow =44 variant === 'ACTIVE' ? 'var(--text-glow-green)' :45 variant === 'WARNING' ? 'var(--text-glow-amber)' :46 variant === 'CRITICAL' ? 'var(--text-glow-red)' :47 'none'4849 const isSmall = size < 805051 return (52 <div53 ref={ref}54 className={cn(className)}55 style={{56 position: 'relative',57 display: 'inline-flex',58 alignItems: 'center',59 justifyContent: 'center',60 width: size,61 height: size,62 fontFamily: 'var(--font-mono)',63 flexShrink: 0,64 ...style,65 }}66 {...props}67 >68 <svg69 width={size}70 height={size}71 style={{ position: 'absolute', inset: 0 }}72 aria-hidden="true"73 >74 {/* Track ring */}75 <circle76 cx={cx} cy={cy} r={r}77 fill="none"78 stroke="var(--border)"79 strokeWidth={strokeWidth}80 />8182 {/* Glow layer — wider, low opacity */}83 {pct > 0 && (84 <circle85 cx={cx} cy={cy} r={r}86 fill="none"87 stroke={accentColor}88 strokeWidth={strokeWidth + 8}89 strokeDasharray={circ}90 strokeDashoffset={offset}91 strokeLinecap="butt"92// … truncated
More from scificn
All 33 items| Component | Registry | Kind | Access | Installs | Command |
|---|---|---|---|---|---|
| Alertalert | scificn | Components | Free | 1 dep | |
| Badgebadge | scificn | Components | Free | 1 dep | |
| Bar Chartbar-chart | scificn | Components | Free | no deps | |
| Breadcrumbbreadcrumb | scificn | Components | Free | no deps | |
| Buttonbutton | scificn | Components | Free | 2 deps | |
| Cardcard | scificn | Components | Free | no deps | |
| Checkboxcheckbox | scificn | Components | Free | 1 dep | |
| Dialogdialog | scificn | Components | Free | 1 dep |
