Storybook is Amazing

I have recently added Storybook to one of the UIs that I am working on.

Storybook is an envitonment for providing a place to display UI components in a catalog. Typically this is used for development of a component library.

It is also useful slightly higher up the stack. Having entire forms or parts of forms testable in isolation is a big win. This allows you to show a form in all its possible states, even if some of them would require exotic conditions.

This can greatly free up development time while ensuring that the component can be refactored.

Having the components testable in isolation makes testing cross browser much easier. You can stand up Storybook locally without any backend services.

Given that I mostly work on an application with a React frontend with a GraphQL backend this reduces the effort on isolating changes to the frontend. So far I have not managed to use the fake GraphQL services, but by splitting the components into GraphQL layers and a pure function allows the pure function to be tested.

Leave a comment