Skip to content

Commit 1e585d4

Browse files
authored
Allow custom styling with className prop
This commit adds the prop 'className' to the ProgressBar component. Using this prop, the main progress bar div can be further styled (for example, setting the 'top' property to control the height)
1 parent b080270 commit 1e585d4

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/ProgressBar.js

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ import classnames from 'classnames';
33

44
class ProgressBar extends React.Component {
55
static propTypes = {
6+
className: React.PropTypes.string,
67
percent: React.PropTypes.number.isRequired,
78
onTop: React.PropTypes.bool,
89
autoIncrement: React.PropTypes.bool,
@@ -79,7 +80,7 @@ class ProgressBar extends React.Component {
7980
render() {
8081
let {onTop, spinner} = this.props;
8182
let {percent} = this.state;
82-
let className = classnames('react-progress-bar', {
83+
let className = classnames('react-progress-bar', this.props.className, {
8384
'react-progress-bar-on-top': onTop,
8485
'react-progress-bar-hide': percent < 0 || percent >= 100
8586
});

0 commit comments

Comments
 (0)