Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
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
- Host: GitHub
- URL: https://github.com/davesnx/reason-storybook-example
- Owner: davesnx
- Created: 2020-02-27T10:08:29.000Z (almost 5 years ago)
- Default Branch: master
- Last Pushed: 2024-03-26T15:16:04.000Z (9 months ago)
- Last Synced: 2024-10-10T18:59:19.805Z (3 months ago)
- Language: JavaScript
- Homepage: https://reason-storybook.netlify.com
- Size: 691 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 2
-
Metadata Files:
- Readme: README.md
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)