apps/mantine.dev/src/pages/core/ring-progress.mdx
import { RingProgressDemos } from '@docs/demos'; import { Layout } from '@/layout'; import { MDX_DATA } from '@/mdx';
export default Layout(MDX_DATA.RingProgress);
The sections prop accepts an array of objects with the following properties:
value – number between 0 and 100 representing the percentage of the ring to fillcolor – segment color from theme.colors or any CSS color valuetooltip (optional) – React node to display when hovering over the section<circle> element props (onClick, onMouseEnter, style, etc.)Note: Section values should sum to 100% or less for expected behavior. Values exceeding 100% total will cause sections to overlap.
<Demo data={RingProgressDemos.usage} />Use the size, thickness & roundCaps props to configure the RingProgress size and thickness values:
Add a tooltip property to a section to display a floating Tooltip when the user hovers over it:
Use the sectionGap prop to add visual separation between sections. The gap is specified in degrees:
Use the startAngle prop to control where the progress starts. The angle is specified in degrees,
where 0 = right, 90 = bottom, 180 = left, and 270 = top (default):
Use the rootColor prop to customize the color of the unfilled portion of the ring (the background):
Each section can receive any valid SVG <circle> element props, including event handlers like onClick, onMouseEnter, and onMouseLeave:
You can add any React node as a label, for example a Text component with custom styling or an ActionIcon:
<Demo data={RingProgressDemos.label} />By default, transitions are disabled. To enable them, set the transitionDuration prop
to a number of milliseconds: