Skip to content

Commit

Permalink
make suffix configurable
Browse files Browse the repository at this point in the history
  • Loading branch information
Lucas Coupez committed Oct 20, 2021
1 parent c995208 commit ad86e57
Show file tree
Hide file tree
Showing 4 changed files with 14,044 additions and 3 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -32,3 +32,4 @@ import Progress from 'react-circle-progress-bar'
| style | undefined | Sets the style on the wrapper component |
| className | undefined | Sets the className on the wrapper component |
| gradient | `[{stop: 0.0, color: '#00bc9b'}, {stop: 1, color: '#5eaefd'}]` | An array of objects, declaring the gradient color of the progress bar. Use 'stop' as percentage, and 'color' as color to declare a gradient. |
| suffix | % | Sets the suffix shown in the progress bar |
5 changes: 3 additions & 2 deletions dist/progress.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,7 +50,8 @@ function _Progress({
}],
subtitle = "",
style,
className
className,
suffix = '%',
}) {
progress = Math.round(progress * 100) / 100;
const width = 200;
Expand Down Expand Up @@ -78,7 +79,7 @@ function _Progress({
color
}) => /*#__PURE__*/React.createElement("stop", {
key: stop,
offset: stop * 100 + "%",
offset: stop * 100 + (suffix || ''),
stopColor: color
})))), !hideValue && /*#__PURE__*/React.createElement("text", {
x: center,
Expand Down
Loading

0 comments on commit ad86e57

Please sign in to comment.