Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/davesnx/reason-storybook-example

Example Storybook with ReasonML
https://github.com/davesnx/reason-storybook-example

Last synced: 2 months ago
JSON representation

Example Storybook with ReasonML

Awesome Lists containing this project

README

        

# ReasonReact with Storybook

This is an example on how to run Storybook with ReasonML. Thanks to [bs-storybook](https://github.com/MyWellGiving/bs-storybook).

[Demo](https://reason-storybook.netlify.com/)

## Goal
- Being able to write ReasonML Stories the same way as React
- Provide a minimum reproducible demo
- Showcase the configuration
- Explore current limitations

## Example

This is how to use Story API
```re
open BsStorybook;

module ButtonWithEmoji = {
[@react.component]
let make = () =>


{React.string({js| 😀 😎 👍 💯 |js})}

;
};

/* module is a reserved keyword in Reason and storybook needs
Node's module for hot-reloading, we get it with bs.raw */
let module_ = [%bs.raw "module"];

Story.storiesOf("Button", module_)
->(Story.add("with Text", () => ));
```

[![Netlify Status](https://api.netlify.com/api/v1/badges/afdc27ef-1fc8-4110-b934-eac10f9cbf9f/deploy-status)](https://app.netlify.com/sites/reason-storybook/deploys)