diff --git a/Circle.js b/Circle.js index fdb793f..84b2ddd 100644 --- a/Circle.js +++ b/Circle.js @@ -43,6 +43,7 @@ export class ProgressCircle extends Component { unfilledColor: PropTypes.string, endAngle: PropTypes.number, allowFontScaling: PropTypes.bool, + text: PropTypes.string, }; static defaultProps = { @@ -97,6 +98,7 @@ export class ProgressCircle extends Component { unfilledColor, endAngle, allowFontScaling, + text, ...restProps } = this.props; @@ -195,14 +197,14 @@ export class ProgressCircle extends Component { style={[ { color, - fontSize: textSize / 4.5, + fontSize: textSize / 2, fontWeight: '300', }, textStyle, ]} allowFontScaling={allowFontScaling} > - {formatText(progressValue)} + {!text ? formatText(progressValue) : text} ) : ( diff --git a/index.d.ts b/index.d.ts index 30c8ae0..b4919ad 100644 --- a/index.d.ts +++ b/index.d.ts @@ -189,6 +189,14 @@ declare module 'react-native-progress' { * @default false */ showsText?: boolean; + + /** + * You can show custom text instead of progress value. + * + * @type {boolean} + * @memberof CirclePropTypes + */ + text?: string | number; /** * A function returning a string to be displayed for the textual representation.