Open r-bt opened 4 years ago
Thanks for the suggestion @richardbeattie . Will try to incorporate this.
I was having a go at it and came up with this. It needs some work and refinements, but it gets the gist of the proposal.
I'm looking forward to disable the primary or secondary button for example. That secondary button isn't showing on last step.
any progress on this one? I really love the progress bar itself and don't need the buttons, so would like to remove the buttons completely. Any idea on how to achieve this?
any progress on this one? I really love the progress bar itself and don't need the buttons, so would like to remove the buttons completely. Any idea on how to achieve this?
@yenicelik I'm not sure if this library is still being maintained so I've forked it to https://github.com/r-bt/react-stepz which incorporates this change so you can use it like
import { StepProgressBar, useStepProgress }
const { stepForward, stepBackwards } = useStepProgress(steps);
// Use stepForward & stepBackwards to handle moving back and forward however you want
return (
<StepProgressBar steps={steps} />
)
Proposal
Expose a
useStepProgress()
hook which returnsstepForward()
&stepBackwards()
to allow custom implementations of the Next and Previous ButtonsReasoning
It would be great to separate some of the UI logic to allow better customization of the library. This way the
buttonWrapperClass
,primaryBtnClass
, andsecondaryBtnClass
props can be removed and users can more easily make their own step forward / backwards navigation.Other
If this is something you'd be interested in adding to the library, I'd be happy to submit a pull-request for it