Phoenix Storybook: a storybook-like UI interface for Phoenix components

I had no idea that the storybook’s demo app deployed on Fly was completely broken, but I just fixed it and redeployed it. I’m impressed by how Fly’s deployment experience has improved over the past 6 months.

Anyway, the demo app is here: https://phoenix-storybook-demo.fly.dev/

2 Likes

If anyone is knowledgeable about dialyxir, I’d gladly use some help with this issue :pray:

I’m still grooming the project issue backlog :broom: and the changelog keeps growing

Still a few bugs to fix and will then start working on 0.6.0 new features:

  • support for dark / light / system modes
  • layout alternatives in the story tab
  • showcase the responsive variations of your components

stay tuned :radio:

7 Likes

Hi, I use ClojureScript instead of JavaScript to add dynamic functionality to my components, e.g dropdown. How can I configure my application to compile my ClojureScript code to Storybook so that the dropdown button’s dynamic functionality works in Storybook?

Storybook doesn’t compile anything on its own. It only documents how you integrate storybook.js into the default phoenix assets pipeline, so eventually a priv/static/assets/storybook.js file is created. You can do all the customizations you have for app.js handling to storybook.js as well.

3 Likes

Okay thank you.

storybook 0.7.0 is under work with light/dark modes first-class support! :sunny: :crescent_moon:

CleanShot2024-02-09at11.39.18-ezgif.com-optimize

11 Likes

is there a way to show the component above the code example intsead side by side ??

Take a look at the layout option: Component stories — phoenix_storybook v0.6.1

1 Like

I was looking to document all the callbacks in the stories module. currently there are only few in the module documentation example.

1 Like

please do! :smiley:

Hey there, it’s been a while!

I just shipped 0.7.0 with support for dark mode :bulb:/:crescent_moon:

You can read the documentation or play with the demo.

5 Likes

Thank you :heart:

1 Like

I’ve listed a few storybooks running in production in the README.

Let me know if you want yours to be added :point_up_2:

4 Likes

Now working on 0.8.0!

Starting with a contribution from @keatz55 on supporting local icons :pray:

This is mostly related to Phoenix preferring heroicons to be referenced as local CSS classes rather than functions from a third-party Elixir package. Read this guide for further details :open_book:

I will now work on improving component documentation rendering, including markdown support: issue #514, issue #515 and issue #516

3 Likes

Up until this point, I only had storybook enabled in development (via guard in router)

I now enabled the storbyook in production (behind basic auth), but no stories show up in production.
Just an empty page:

What am I doing wrong?

FYI: this is deployed on fly with a dockerfile.

Did you copy the storybook resources in your Docker layers?

1 Like

I noticed the mix phx.gen.storybook task prompts you to add this directive but it is missing from the manual setup guide.

I will get it fixed
Fixed :ok_hand:

That fixes most of it.
What’s not fixed yet is that now storybook.css doesn’t exist, but it’s something like storybook-[some hash].css

I’m not sure what is off in your setup.

It would help if you compared it with the demo app repository which is also deploying on Fly with Docker.