Skip to content

do-wa/xstate-addon

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

24 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

WARNING

this project is not actively maintained

based on xstate v3.2 and storybook v3.4

xstate-addon

A storybook addon project for xstate (https://github.com/davidkpiano/xstate)

The project is in an early stage. Everyone who is interested in bringing this project forward is welcome to contribute ideas, docs and code.

install

npm i storybook-addon-xstate -D

register

addons.js

import 'storybook-addon-xstate/register';

story

import { WithXStateGraph } from 'storybook-addon-xstate';

<WithXStateGraph
   machine={xstateMachine}
   onTransition={onEvent}
   currentState={currentState}
>
  <TrafficLight light={currentState} />
 </WithXStateGraph>

basic idea

Basic Idea

About

Storybook addon for xstate

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published