Skip to content

Commit

Permalink
documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
jay-deshmukh committed Oct 8, 2024
1 parent 0b56c8b commit f938740
Showing 1 changed file with 36 additions and 0 deletions.
36 changes: 36 additions & 0 deletions src/components/Stepper/index.js
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,39 @@ export const Step = ({ children }) => {
Stepper.Step = Step;

export default Stepper;


import PropTypes from 'prop-types';

Stepper.propTypes = {
/**
* The steps of the stepper. Should be Stepper.Step components.
*/
children: PropTypes.oneOfType([
PropTypes.arrayOf(PropTypes.element),
PropTypes.element
]).isRequired,

/**
* Function to be called when the stepper is finished.
*/
onFinish: PropTypes.func.isRequired,

/**
* Function to validate each step. Should return true if valid, false otherwise.
*/
stepValidator: PropTypes.func,

/**
* Error message to display when a step is invalid.
*/
stepErrMessage: PropTypes.string
};

Stepper.defaultProps = {
stepErrMessage: 'ERROR'
};

Step.propTypes = {
children: PropTypes.node.isRequired
};

0 comments on commit f938740

Please sign in to comment.