Skip to content

Instantly share code, notes, and snippets.

@phylliswong
Created December 13, 2018 00:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save phylliswong/41ffcd0ab53ae3da161887f9ec24791e to your computer and use it in GitHub Desktop.
Save phylliswong/41ffcd0ab53ae3da161887f9ec24791e to your computer and use it in GitHub Desktop.
Simple progress bar component with inline style
import React from 'react'
// ES6 JS object
const containerStyle = {
'position': 'relative',
'height': '20px',
'width': '350px',
'border-radius': '350px',
'border': '1px solid #333'
};
// ES6 JS object
const fillerStyle = {
'background': '#1da598',
'height': '100%',
'border-radius': 'inherit',
'textAlign': 'center',
'transition': 'width .2s ease-in'
};
// function style component
const ProgressBar = (props) => {
return (
<div className='progress-bar' style={containerStyle}>
<Filler style={fillerStyle} />
</div>
)
}
const Filler = (props) => {
return <div className='filler' />
}
export default ProgressBar
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment