Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions Circle.js
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ export class ProgressCircle extends Component {
unfilledColor: PropTypes.string,
endAngle: PropTypes.number,
allowFontScaling: PropTypes.bool,
text: PropTypes.string,
};

static defaultProps = {
Expand Down Expand Up @@ -97,6 +98,7 @@ export class ProgressCircle extends Component {
unfilledColor,
endAngle,
allowFontScaling,
text,
...restProps
} = this.props;

Expand Down Expand Up @@ -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}
</Text>
</View>
) : (
Expand Down
8 changes: 8 additions & 0 deletions index.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down