Skip to content

v3.1.0 — Step Validation, Reset & Richer Callbacks

Latest

Choose a tag to compare

@sametweb sametweb released this 12 Mar 19:59
· 2 commits to master since this release

🚀 New Features

  • reset() — New function from useSteps() to return to the first step. Perfect for "Start Over" flows.
  • beforeNext validation guard — Block navigation with sync or async validation. Pass a function to the <Steps> component that returns false to prevent moving forward. next() now returns Promise<boolean> so you can react to blocked navigation.
  • onStepChange context — The callback now optionally receives { from, to } with the previous and next step numbers.

🐛 Bug Fixes

  • Fixed progress returning NaN when there is only one step
  • Fixed TypeScript type definitions for StepsProvider and Steps components

⚙️ Internal

  • Migrated test runner from Jest to Vitest
  • Fixed broken import paths (./dist./lib-ts)
  • Added proper Vite entry point (index.html)

📦 Compatibility

All changes are fully backward-compatible. Existing code works without modification.