You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
BuckleScript bindings for Storybook.js! The goal of this project is to provide bindings for the main Storybook API, as well as the official add-ons. Currently it supports:
3
+
BuckleScript bindings for **[Storybook](https://storybook.js.org/)**.
4
+
5
+
The goal of this project is to provide bindings for the main Storybook API, as well as the official add-ons. Currently it supports:
Next, you'll need to add `bs-storybook` to your `bsconfig.json` as a dependency.
18
20
19
-
Then, get Storybook up and running according to [their docs](https://storybook.js.org/basics/quick-start-guide/). (_Note:_ This library does not attempt to provide a way to configure storybook in Reason - just use the standard JS configs.)
21
+
Then, get Storybook up and running according to [their docs](https://storybook.js.org/basics/quick-start-guide/)
22
+
23
+
> **Note:** This library does not attempt to provide a way to configure storybook in Reason - just use the standard JS configs.
20
24
21
-
In your `/.storybook/config.js`, import your stories from wherever your compiled Reason modules end up. For example, if you're writing your stories inside a `__stories__` directory, and `bsb` is configured for a standard build, you might do something like:
25
+
In your `/.storybook/config.js`, import your stories from wherever your compiled Reason modules end up.
26
+
For example, if you're writing your stories inside a `__stories__` directory, and `bsb` is configured for a standard build, you might do something like:
Note that in the above example, we're assuming the convention of each module containing a function as the `default` export. We'll account for that when writing our stories in the next section.
Note that in the above example, we're assuming the convention of each module containing a function as the `default` export. bs-storybook is accountable for that while writting your stories:
let name = Knobs.text(~label="Name", ~defaultValue="Patrick", ());
114
+
<span> {React.string(name)} </span>;
115
+
})
67
116
```
68
117
69
-
Each knob type is invoked using a function with labeled arguments, and each requires passing `unit` as the final argument. They all share a `~label` argument, and a `~defaultValue` argument (where appropriate);
118
+
Each knob type is invoked using a function with labeled arguments, and each requires passing `unit` as the final argument. They all share a `~label` argument, and a `~defaultValue` argument (where appropriate):
70
119
71
120
### Text
72
121
@@ -95,11 +144,11 @@ The number type works with floats. If no `defaultValue` is provided, it will pas
0 commit comments