Storybook 8.1 brings story auto-generation, type-safe module mocking, and more
Storybook has released version 8.1, introducing several key features for building UI components and pages in isolation. Users can now create and edit stories directly from Storybook’s UI, and React projects can add stories for new components. The update brings type-safe module mocking, allowing flexible swapping of JavaScript modules. This enables mocking of component inputs from various sources such as browser cookies, local storage, or application routers.
A significant advancement is the capability to unit test React Server Components (RSCs) by mocking the server modules they depend on, addressing a previous gap in React’s testing strategy. Additionally, Storybook 8.1 facilitates the reuse of isolated component examples in Playwright’s experimental component testing, merging component development and documentation with robust testing features.
The update also includes hundreds of improvements and bug fixes, such as experimental support for React 19 and Angular 18.
