{"id":19614351,"url":"https://github.com/fpapado/elm-react-storybook","last_synced_at":"2026-05-16T19:07:35.265Z","repository":{"id":96504909,"uuid":"103021110","full_name":"fpapado/elm-react-storybook","owner":"fpapado","description":null,"archived":false,"fork":false,"pushed_at":"2017-09-10T13:12:31.000Z","size":74,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-02-26T17:48:00.879Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"Elm","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/fpapado.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"license.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2017-09-10T10:30:23.000Z","updated_at":"2017-09-10T13:13:35.000Z","dependencies_parsed_at":null,"dependency_job_id":"5960c04c-fde1-41fa-8bdb-c605bab094a3","html_url":"https://github.com/fpapado/elm-react-storybook","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/fpapado/elm-react-storybook","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Felm-react-storybook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Felm-react-storybook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Felm-react-storybook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Felm-react-storybook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/fpapado","download_url":"https://codeload.github.com/fpapado/elm-react-storybook/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/fpapado%2Felm-react-storybook/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":33115460,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-05-16T18:38:32.183Z","status":"ssl_error","status_checked_at":"2026-05-16T18:38:29.903Z","response_time":115,"last_error":"SSL_read: unexpected eof while reading","robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":false,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2024-11-11T10:51:34.675Z","updated_at":"2026-05-16T19:07:35.249Z","avatar_url":"https://github.com/fpapado.png","language":"Elm","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Elm-react-storybook\nAn example of using Elm with [`react-storybook`](https://github.com/storybooks/storybook/tree/master/app/react).\n\nThis was inspired by [https://github.com/kalutheo/elm-calendar-react-storybook](https://github.com/kalutheo/elm-calendar-react-storybook), specifically the technique of using `programWithFlags` combined with a wrapper for Elm in React.\n\nI do not use `create-elm-app`, thus this one has a more basic main app, focusing on getting storybook to work.\nMoreover, this is using storybook v3.\n\nFinally, I wish to create a storybook purely in elm, instead of going through react, but I need to understand how it works first :)\n\n## Running Storybook\n```shell\nyarn global add @storybook/cli\nyarn global add elm\ncd app\nelm-package install\nyarn\nyarn run storybook\n```\n\n## How?\n- A separate App is created, that imports each view, under `Storybook/SomeView.elm`\n- We use [`programWithFlags`](http://package.elm-lang.org/packages/elm-lang/html/2.0.0/Html#programWithFlags) so that we can inject data (i.e. view function arguments) from Javascript to these Elm Apps\n- We import these Elm Apps into ReactStoryBook thanks to the [elm-webpack-loader](https://github.com/elm-community/elm-webpack-loader)\n- These Elm Apps are then wrapped into React thanks to a small wrapper (see : [src/stories/Elm.js](https://github.com/fpapado/elm-react-storybook/blob/master/app/stories/Elm.js))\n\n## Pros / Cons of this approach\nThis approach has the benefit of potentially leveraging the storybook ecosystem and using existing tools.\n\nThe downsides imo, compared to a version in Elm, are as follows:\n  - Separate / opaque webpack configurations when running alongside existing app\n    - This would probably also be an issue with an Elm version, but the extra config would be simpler\n  - Reliance on ports encoding / decoding.\n    - For simple values, this is cool, because you don't need to define anything\n    - If one of your views takes a \"complex\" value that ports cannot translate automatically, then you have to decode Json.Value. You might not have this logic in your application, thus serialising most of the types seems like a hassle.\n  - Slower feedback loop\n    - Updates are slower with all this indirection\n  - Type checking?\n    - If you encode/decode at the boundary, you can catch these at runtime, but not while writing your stories.\n\n## License\n\nMIT © Fotis Papadogeorgopoulos\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Felm-react-storybook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ffpapado%2Felm-react-storybook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ffpapado%2Felm-react-storybook/lists"}