{"id":13682366,"url":"https://github.com/rnons/purescript-halogen-storybook","last_synced_at":"2025-03-06T11:25:24.095Z","repository":{"id":28303305,"uuid":"117988642","full_name":"rnons/purescript-halogen-storybook","owner":"rnons","description":"A library to assemble examples or develop components separately.","archived":false,"fork":false,"pushed_at":"2022-05-03T14:29:22.000Z","size":591,"stargazers_count":37,"open_issues_count":0,"forks_count":6,"subscribers_count":4,"default_branch":"master","last_synced_at":"2025-02-16T09:07:40.051Z","etag":null,"topics":["examples","halogen","purescript"],"latest_commit_sha":null,"homepage":"https://rnons.github.io/purescript-halogen-storybook/","language":"PureScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"bsd-3-clause","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/rnons.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-01-18T13:47:16.000Z","updated_at":"2024-08-29T08:25:32.000Z","dependencies_parsed_at":"2022-07-27T09:22:10.965Z","dependency_job_id":null,"html_url":"https://github.com/rnons/purescript-halogen-storybook","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-halogen-storybook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-halogen-storybook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-halogen-storybook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/rnons%2Fpurescript-halogen-storybook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/rnons","download_url":"https://codeload.github.com/rnons/purescript-halogen-storybook/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":242198835,"owners_count":20088119,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","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":["examples","halogen","purescript"],"created_at":"2024-08-02T13:01:44.889Z","updated_at":"2025-03-06T11:25:24.074Z","avatar_url":"https://github.com/rnons.png","language":"PureScript","funding_links":[],"categories":["PureScript"],"sub_categories":[],"readme":"# purescript-halogen-storybook\n\n\u003ca href=\"https://pursuit.purescript.org/packages/purescript-halogen-storybook\"\u003e\n  \u003cimg src=\"https://pursuit.purescript.org/packages/purescript-halogen-storybook/badge\"\n       alt=\"purescript-halogen-storybook on Pursuit\"\u003e\n  \u003c/img\u003e\n\u003c/a\u003e\n\nA library to assemble examples or develop components separately.\n\n[DEMO](https://rnons.github.io/purescript-halogen-storybook/)\n\nYou might be interested in [purescript-halogen-custom-element](https://github.com/nonbili/purescript-halogen-custom-element) which allows embedding Halogen components anywhere in an HTML or Markdown file.\n\n## How to use\n\nFirst define the stories. Each story consists of a name and a component. If the name is empty string, it will be rendered as the index page.\n\n```purescript\nimport Foreign.Object as Object\nimport Halogen.Storybook (Stories, runStorybook, proxy)\n\nstories :: forall m. Stories m\nstories = Object.fromFoldable\n  [ Tuple \"\" $ proxy ExpIndex.component -- override the index page\n  , Tuple \"count\" $ proxy ExpCount.component\n  , Tuple \"input\" $ proxy ExpInput.component\n  ]\n```\n\nThen add a `runStorybook` line to your main function. That's it.\n\n```purescript\nmain = HA.runHalogenAff do\n  HA.awaitBody \u003e\u003e=\n    runStorybook\n      { stories\n      , logo: Nothing  -- pass `Just HH.PlainHTML` to override the logo\n      }\n```\n\nYou need to include the CSS by yourself, use [Storybook.css](https://github.com/rnons/purescript-halogen-storybook/blob/master/examples/src/Storybook.css) as an example.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fpurescript-halogen-storybook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Frnons%2Fpurescript-halogen-storybook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Frnons%2Fpurescript-halogen-storybook/lists"}