Skip to main content
Tw Twintrinsic
  • Getting Started
  • Components
  • Theming
  • Completion
Examples
Data Dashboard Game Map
Core
App
Layout
Accordion AccordionItem Card Container Panel Separator Sidebar Splitter
Navigation
AppHeader BottomBar Breadcrumb BreadcrumbItem Menu MenuItem Tabs Tab TabList TabPanel TreeMenu
Data Display
Avatar AvatarGroup Badge Carousel CarouselItem Chip ChipGroup CodeBlock CodeBlockSpeed CodeEditor DataTable Map Progress Skeleton Table TableBody TableCell TableHead TableHeader TableRow Tag TagGroup Timeline TimelineItem Tooltip Tree TreeNode
Metrics
DonutChart PieChart LineChart BarChart HorizontalBarChart AreaChart StatsCard MetricGrid KPICard GaugeChart ProgressMetric MetricTrend
Form
AutoComplete Button ButtonGroup Calendar Checkbox ColorPicker Combobox Dropdown FileUpload FloatLabel Form FormField Input InputSwitch InvalidState Knob ListInput Listbox NumberInput Radio RadioGroup Rating Select SelectGroup Slider Switch TextInput Textarea
Feedback
Modal Stepper StepperStep Toast
Utility
Icon Lazy LazyPanel Masonry ThemeToggle

GaugeChart

A circular gauge chart for displaying a value within a range. Perfect for showing performance metrics, progress, or status indicators. Features configurable arcs, tic marks, and color zones.

Features

  • Circular gauge display with configurable arc angles
  • Customizable min/max range
  • Needle indicator
  • Percentage display
  • Customizable colors
  • Optional label and unit
  • Responsive sizing
  • Configurable tic marks with labels
  • Color zones for value ranges
  • Min/max labels at arc endpoints

Examples

Basic GaugeChart

Performance Score

0%100%75%
<script>
  import { GaugeChart } from '$lib';
</script>

<GaugeChart
  value={75}
  min={0}
  max={100}
  label="Performance Score"
  unit="%"
  color="primary"
/>

With Tic Marks

Customer Satisfaction

02550751000%100%71%

With Color Zones

Walmart's Customer Satisfaction Score

02550751000%100%71%

Full Circle Gauge

System Health

0204060801000%100%65%

Props

PropTypeDefaultDescription
valuenumberRequiredCurrent value
minnumber0Minimum value
maxnumber100Maximum value
labelstringundefinedGauge label
unitstringundefinedUnit of measurement
colorstring'primary'Gauge color theme (primary, secondary, success, danger, warning, info)
sizenumber200Gauge size in pixels
arcStartnumber0Arc start angle in degrees (0 = horizontal left, 90 = vertical top)
arcEndnumber180Arc end angle in degrees
ticsTicConfig{}Tic mark configuration (show, step, values, showLabels, format)
zonesColorZone[][]Color zones for value ranges (start, end, color, label)

Tic Configuration

The tics prop accepts an object with the following properties:

PropertyTypeDescription
showbooleanShow tic marks
stepnumberStep size for tics (if not using custom values)
valuesnumber[]Custom values to show as tics (overrides step)
showLabelsbooleanShow tic labels
format(value: number) => stringFormat function for tic labels

Color Zones

The zones prop accepts an array of objects with the following properties:

PropertyTypeDescription
startnumberStart value for the zone
endnumberEnd value for the zone
colorstringColor for the zone (hex or CSS color)
labelstringOptional label for the zone

Best Practices

  • Use for single metric displays
  • Include meaningful labels and units
  • Use color zones to indicate status ranges
  • Keep ranges intuitive and meaningful
  • Use tic marks to help users understand the scale
  • Angle specifications: 0° = horizontal left, 90° = vertical top, 180° = horizontal right, 270° = vertical bottom