Skip to content

Commit fb1ff2e

Browse files
author
Nicholas Barone
committed
Update README
1 parent ff1b07b commit fb1ff2e

File tree

1 file changed

+28
-3
lines changed

1 file changed

+28
-3
lines changed

README.md

Lines changed: 28 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,15 +14,40 @@ Add this line to your application's Gemfile:
1414
gem 'rails-storybook'
1515
```
1616

17-
TODO
17+
Then:
18+
```bash
19+
rails g storybook:install
20+
```
21+
22+
Then, optionally:
23+
```bash
24+
rails g storybook:example
25+
```
26+
27+
Restart your processes (stop and restart `./bin/dev`) and viola! Opens up a Storybook connected to your Rails server, and if you've also generated the example, will have a simple View Component showing up in Storybook.
1828

1929
## Usage
2030

21-
TODO: Write usage instructions here
31+
Today, write a JSON to describe your View Component's "story":
32+
```
33+
{
34+
"title": "ExampleComponent",
35+
"stories": [
36+
{
37+
"name": "default",
38+
"parameters": {
39+
"server": { "id": "example_component/default" }
40+
}
41+
}
42+
]
43+
}
44+
```
45+
46+
Tomorrow(tm), run a rake task to generate those stories for you.
2247

2348
## Development
2449

25-
TODO
50+
Inspired by [gem view_component-storybook](https://github.com/jonspalmer/view_component-storybook), but, I want to accomplish things in a different way (using the existing view component previews), to aim higher (handling view components, partials, *and* React components), and to aim specifically at integration with Chromatic.
2651

2752
After checking out the repo, run `bin/setup` to install dependencies. Then, run `rake spec` to run the tests. You can also run `bin/console` for an interactive prompt that will allow you to experiment.
2853

0 commit comments

Comments
 (0)