UNPKG

@gfazioli/mantine-rings-progress

Version:
46 lines (45 loc) 1.81 kB
import React from 'react'; import { BoxProps, ElementProps, Factory, MantineColor, StylesApiProps } from '@mantine/core'; export interface RingProgressSection extends React.ComponentPropsWithRef<'circle'> { value: number; color: MantineColor; tooltip?: React.ReactNode; } export type RingProgressStylesNames = 'root' | 'svg' | 'label' | 'curve'; export type RingProgressCssVariables = { root: '--rp-size' | '--rp-label-offset'; }; export interface RingProgressProps extends BoxProps, StylesApiProps<RingProgressFactory>, ElementProps<'div'> { /** Label displayed in the center of the ring */ label?: React.ReactNode; /** Ring thickness */ thickness?: number; /** Width and height of the progress ring */ size?: number; /** Sets whether the edges of the progress circle are rounded */ roundCaps?: boolean; /** Ring sections */ sections: RingProgressSection[]; /** Color of the root section, key of theme.colors or CSS color value */ rootColor?: MantineColor; /** Animate */ animate?: boolean; /** Animation duration in ms */ animationDuration?: number; /** Animation steps */ animationSteps?: number; /** Animation timing function to define the speed curve of the animation */ animationTimingFunction?: 'linear' | 'ease' | 'ease-in' | 'ease-out' | 'ease-in-out' | 'ease-in-cubic' | 'ease-out-cubic' | 'ease-in-out-cubic'; } export type RingProgressFactory = Factory<{ props: RingProgressProps; ref: HTMLDivElement; stylesNames: RingProgressStylesNames; vars: RingProgressCssVariables; }>; export declare const RingProgress: import("@mantine/core").MantineComponent<{ props: RingProgressProps; ref: HTMLDivElement; stylesNames: RingProgressStylesNames; vars: RingProgressCssVariables; }>;