add demo example for customizing background

This commit is contained in:
Kevin Qi 2017-10-13 20:51:56 -07:00
parent 2cc2558a9f
commit e1aa435c55
3 changed files with 620 additions and 911 deletions

View File

@ -21,7 +21,7 @@ const Config = ({ name, example, description, children }) => (
);
const Example = ({ description, children }) => (
<div className="col-xs-12 col-sm-6">
<div className="col-xs-12 col-sm-4">
<div className="row mb-1">
<div className="col-xs-4 offset-xs-4">
{children}
@ -97,7 +97,7 @@ class Demo extends React.Component {
</Example>
<Example
description="Configure text formatting and stroke width."
description="Customize text formatting and stroke width."
>
<CircularProgressbar
percentage={50}
@ -105,6 +105,16 @@ class Demo extends React.Component {
textForPercentage={(percentage) => `$${percentage}`}
/>
</Example>
<Example
description="Add a background color."
>
<CircularProgressbar
className="background"
strokeWidth={10}
percentage={33}
/>
</Example>
</div>
<hr />

View File

@ -19,7 +19,7 @@
text-decoration: none;
}
/* demo - how to customize colors based on percentage */
/* demo style overrides */
.CircularProgressbar.incomplete .CircularProgressbar-path {
stroke: #f66;
}
@ -32,6 +32,20 @@
.CircularProgressbar.complete .CircularProgressbar-text {
fill: #99f;
}
/* demo - background styles */
.CircularProgressbar.background .CircularProgressbar-background {
fill: #3e98c7;
}
.CircularProgressbar.background .CircularProgressbar-text {
fill: #fff;
}
.CircularProgressbar.background .CircularProgressbar-path {
stroke: #fff;
}
.CircularProgressbar.background .CircularProgressbar-trail {
stroke: transparent;
}
</style>
</head>
<body>

File diff suppressed because it is too large Load Diff