BlockDex

Components

Registries

Free blocks

Method

BlockDex

Components

Registries

Free blocks

Method

Open API

BlockDex

Components

Registries

Free blocks

Method

Open API

Components/diceui/radix/gauge

gauge

diceui-radix/gauge
FreeComponent

diceui/radix publishes no description for this item.

Install it

npx shadcn@latest add https://raw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/radix-nova/gauge.json

Source

ui/gauge.tsxraw.githubusercontent.com/sadmann7/diceui/HEAD/docs/public/r/styles/radix-nova/gauge.json · first 6 KB
1"use client";
2
3import { Slot as SlotPrimitive } from "radix-ui";
4import * as React from "react";
5import { cn } from "@/lib/utils";
6
7const GAUGE_NAME = "Gauge";
8const INDICATOR_NAME = "GaugeIndicator";
9const TRACK_NAME = "GaugeTrack";
10const RANGE_NAME = "GaugeRange";
11const VALUE_TEXT_NAME = "GaugeValueText";
12const LABEL_NAME = "GaugeLabel";
13
14const DEFAULT_MAX = 100;
15const DEFAULT_START_ANGLE = 0;
16const DEFAULT_END_ANGLE = 360;
17
18type GaugeState = "indeterminate" | "complete" | "loading";
19
20interface DivProps extends React.ComponentProps<"div"> {
21 asChild?: boolean;
22}
23
24interface PathProps extends React.ComponentProps<"path"> {}
25
26function getGaugeState(
27 value: number | undefined | null,
28 maxValue: number,
29): GaugeState {
30 return value == null
31 ? "indeterminate"
32 : value === maxValue
33 ? "complete"
34 : "loading";
35}
36
37function getIsValidNumber(value: unknown): value is number {
38 return typeof value === "number" && Number.isFinite(value);
39}
40
41function getIsValidMaxNumber(max: unknown): max is number {
42 return getIsValidNumber(max) && max > 0;
43}
44
45function getIsValidValueNumber(
46 value: unknown,
47 min: number,
48 max: number,
49): value is number {
50 return getIsValidNumber(value) && value <= max && value >= min;
51}
52
53function getDefaultValueText(value: number, min: number, max: number): string {
54 const percentage = max === min ? 100 : ((value - min) / (max - min)) * 100;
55 return Math.round(percentage).toString();
56}
57
58function getInvalidValueError(
59 propValue: string,
60 componentName: string,
61): string {
62 return `Invalid prop \`value\` of value \`${propValue}\` supplied to \`${componentName}\`. The \`value\` prop must be a number between \`min\` and \`max\` (inclusive), or \`null\`/\`undefined\` for indeterminate state. The value will be clamped to the valid range.`;
63}
64
65function getInvalidMaxError(propValue: string, componentName: string): string {
66 return `Invalid prop \`max\` of value \`${propValue}\` supplied to \`${componentName}\`. Only numbers greater than 0 are valid. Defaulting to ${DEFAULT_MAX}.`;
67}
68
69function getNormalizedAngle(angle: number) {
70 return ((angle % 360) + 360) % 360;
71}
72
73function polarToCartesian(
74 centerX: number,
75 centerY: number,
76 radius: number,
77 angleInDegrees: number,
78) {
79 const angleInRadians = ((angleInDegrees - 90) * Math.PI) / 180.0;
80 return {
81 x: centerX + radius * Math.cos(angleInRadians),
82 y: centerY + radius * Math.sin(angleInRadians),
83 };
84}
85
86function describeArc(
87 x: number,
88 y: number,
89// … truncated

What it pulls in

npm packages

  • radix-ui

Files it writes

  • ui/gauge.tsx
  • lib/compose-refs.ts

Facts

Registry
diceui/radix
Type
registry:ui
Access
Free
Files written
2
Licence
the repository states none
In the index
at or before 2026-08-11
Last confirmed
3 days ago

Go to the source

www.diceui.com sadmann7/diceui on GitHub Raw registry item This item as JSON

More from diceui/radix

All 58 items
Same registry, same kind — the ones you would have found next
ComponentRegistryKindAccessInstallsCommand
action-baraction-bardiceui/radixComponentsFree1 dep · 2 files
angle-sliderangle-sliderdiceui/radixComponentsFree1 dep · 3 files
avatar-groupavatar-groupdiceui/radixComponentsFree1 dep
badge-overflowbadge-overflowdiceui/radixComponentsFree1 dep · 2 files
bannerbannerdiceui/radixComponentsFree1 dep
checkbox-groupcheckbox-groupdiceui/radixComponentsFree1 dep
circular-progresscircular-progressdiceui/radixComponentsFree1 dep
client-onlyclient-onlydiceui/radixComponentsFreeno deps

Also from Kynth Studios

Built for the same person as BlockDex

SkillWorks

Claude Code skills and plugins, scored

skillworks.kynth.studio

RuleStack

AGENTS.md gallery and agent-config comparison

rulestack.kynth.studio

ToolDrift

What the AI coding tools changed last night

tooldrift.kynth.studio

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex

The studio list

One product, taken apart, once a month

Kynth Studios pulls one shipped product open every month — what it does, what it cost to build, what the pipeline behind it looks like, and what the numbers did. One email a month, nothing in between.

Double opt-in — we send one confirmation link and nothing else until you click it.

BlockDex

Built by

Kynth Studios

the studio behind SkillWorks, RuleStack and ToolDrift

part of Toolproof, the measurement layer for AI agent tooling

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

© 2026 BlockDex. A Kynth Studios product. Changelog

BlockDex