mirror of
https://github.com/kevinsqi/react-circular-progressbar.git
synced 2026-01-18 15:55:06 +00:00
Get text working
This commit is contained in:
parent
a070d72c9f
commit
3e1c7d5fb3
@ -39,7 +39,13 @@ class CircularProgressbar extends React.Component {
|
||||
style={progressStyle}
|
||||
/>
|
||||
|
||||
<text>Hello</text>
|
||||
<text
|
||||
className="CircularProgressbar-text"
|
||||
x={50}
|
||||
y={50}
|
||||
>
|
||||
{this.props.textForPercentage(this.props.percentage)}
|
||||
</text>
|
||||
</svg>
|
||||
);
|
||||
}
|
||||
@ -51,6 +57,7 @@ CircularProgressbar.propTypes = {
|
||||
|
||||
CircularProgressbar.defaultProps = {
|
||||
strokeWidth: 8,
|
||||
textForPercentage: (percentage) => `${percentage}%`,
|
||||
};
|
||||
|
||||
export default CircularProgressbar;
|
||||
|
||||
@ -7,9 +7,15 @@
|
||||
.CircularProgressbar .CircularProgressbar-path {
|
||||
stroke: #3c3;
|
||||
stroke-linecap: round;
|
||||
transition: stroke-dashoffset 0.6s ease 0s, stroke 0.6s ease;
|
||||
transition: stroke-dashoffset 0.5s ease 0s;
|
||||
}
|
||||
|
||||
.CircularProgressbar .CircularProgressbar-trail {
|
||||
stroke: #d6d6d6;
|
||||
}
|
||||
|
||||
.CircularProgressbar .CircularProgressbar-text {
|
||||
font-size: 20px;
|
||||
dominant-baseline: middle;
|
||||
text-anchor: middle;
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user