|

   Veteran Tools Platform - Developer Documentation

There are no notes for this item.

PropRequired?TypeDefaultDescription
percent Yes number Percent of progress made
<div id="reactMount" data-tpl="progressbar">
    <div class="progress-bar" role="progressbar" aria-valuenow="35" aria-valuemin="0" aria-valuemax="100" tabindex="0">
        <div class="progress-bar-inner" style="width:35%;"></div>
    </div>
</div>
<script>
    window.currentProps = {
        "package": {
            "name": "department-of-veteran-affairs/jean-pants",
            "version": "0.1.0"
        },
        "assetPath": "/design-system/",
        "isProduction": true,
        "componentSourcePath": "ProgressBar.jsx",
        "percent": 35
    }
</script>
import React from 'react';
import ProgressBar from './ProgressBar';

export default function ProgressBarExample(props) {
  return (
    <ProgressBar
      percent={props.percent}/>
  );
}
package:
  name: department-of-veteran-affairs/jean-pants
  version: 0.1.0
assetPath: /design-system/
isProduction: true
componentSourcePath: ProgressBar.jsx
percent: 35
  • Content:
    import React from 'react';
    import PropTypes from 'prop-types';
    
    export default function ProgressBar({ percent }) {
      return (
        <div className="progress-bar" role="progressbar" aria-valuenow={percent} aria-valuemin="0" aria-valuemax="100" tabIndex="0">
          <div className="progress-bar-inner" style={{ width: `${percent}%` }}/>
        </div>
      );
    }
    
    ProgressBar.propTypes = {
      /**
       * Percent of progress made
       */
      percent: PropTypes.number.isRequired,
    };
    
  • URL: /components/raw/progressbar/ProgressBar.jsx
  • Filesystem Path: src/components/form/ProgressBar/ProgressBar.jsx
  • Size: 462 Bytes
  • Content:
    import React from 'react';
    import { shallow } from 'enzyme';
    import { expect } from 'chai';
    import { axeCheck } from '../../../../lib/testing/helpers';
    
    import ProgressBar from './ProgressBar.jsx';
    
    describe('<ProgressBar/>', () => {
      it('should render', () => {
        const tree = shallow(<ProgressBar percent={35}/>);
        expect(tree.find('.progress-bar-inner')).to.have.length(1);
      });
    
      it('should pass aXe check', () => {
        return axeCheck(<ProgressBar percent={35}/>);
      });
    });
    
  • URL: /components/raw/progressbar/ProgressBar.unit.spec.jsx
  • Filesystem Path: src/components/form/ProgressBar/ProgressBar.unit.spec.jsx
  • Size: 488 Bytes