{"id":17091789,"url":"https://github.com/psharanda/nativebook","last_synced_at":"2025-04-12T22:41:02.690Z","repository":{"id":210601350,"uuid":"726653928","full_name":"psharanda/NativeBook","owner":"psharanda","description":"A toolkit for Implementing, maintaining, documenting and evolving a shared set of UI components for iOS inspired by Storybook.js","archived":false,"fork":false,"pushed_at":"2024-02-10T21:45:16.000Z","size":659,"stargazers_count":17,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"main","last_synced_at":"2025-03-26T16:47:33.106Z","etag":null,"topics":["design-system","ios","snapshot-testing","swiftui-previews","ui-components","uikit","uiview"],"latest_commit_sha":null,"homepage":"","language":"Swift","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/psharanda.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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}},"created_at":"2023-12-03T01:05:21.000Z","updated_at":"2025-03-06T08:26:36.000Z","dependencies_parsed_at":"2023-12-30T19:43:34.333Z","dependency_job_id":null,"html_url":"https://github.com/psharanda/NativeBook","commit_stats":null,"previous_names":["psharanda/nativebook"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psharanda%2FNativeBook","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psharanda%2FNativeBook/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psharanda%2FNativeBook/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/psharanda%2FNativeBook/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/psharanda","download_url":"https://codeload.github.com/psharanda/NativeBook/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248643045,"owners_count":21138353,"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":["design-system","ios","snapshot-testing","swiftui-previews","ui-components","uikit","uiview"],"created_at":"2024-10-14T13:59:31.631Z","updated_at":"2025-04-12T22:41:02.663Z","avatar_url":"https://github.com/psharanda.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# NativeBook\n## Intro\n\nImplementing, maintaining, documenting and evolving a shared set of UI components is not an easy thing in a large-scale application. Web developers have created a powerful solution for this process - Storybook.js. But what about native iOS development? Can we achieve a somewhat similar experience?\n\nWhat if we combine a catalog app, snapshot tests, and HTML-based documentation generation into a single system? \n\nImagine writing a code snippet just once, and then being able to do the following:\n- Display a view produced from a snippet in a native catalog app\n- Embed a view into SwiftUI previews\n- Run a snapshot test for a snippet\n- Display this code snippet and the resulting snapshot in a generated HTML-based documentation\n\nThis repo is a proof of the concept for such a system!\n\nCheck my article about NativeBook for more details:\nhttps://hackernoon.com/nativebook-unifying-the-native-ios-development-experience-with-storybookjs\n\n## Snippet\n\n```swift\nclass UIButtonStories: DynamicComponentStories {\n  @objc static func story_ImageTitleButton() -\u003e UIView {\n        let button = UIButton()\n        var config = UIButton.Configuration.plain()\n        config.title = \"Image + Title\"\n        config.image = UIImage(systemName: \"bell\")\n        config.imagePlacement = .top\n        config.titlePadding = 10\n        button.configuration = config\n        return button\n    }\n   ...\n}\n```\n\n## Catalog\n\u003cimg width=\"320\" src=\"https://github.com/psharanda/NativeBook/assets/2247256/eb319f5e-7acc-4ae3-ad39-a72225de1c00\"\u003e\n\n## SwiftUI Preview\n\u003cimg width=\"640\" src=\"https://github.com/psharanda/NativeBook/assets/2247256/305c9dd8-1ae7-4a18-a59e-544096ec6352\"\u003e\n\n## Snapshot tests\n\u003cimg width=\"640\" src=\"https://github.com/psharanda/NativeBook/assets/2247256/344ca96c-f85e-43c3-9362-9639cf024035\"\u003e\n\n## Documentation\nSite: [https://psharanda.github.io/NativeBook](https://psharanda.github.io/NativeBook)\n\n\u003cimg width=\"640\" src=\"https://github.com/psharanda/NativeBook/assets/2247256/99b78193-2ae4-4ac1-9228-6851efe50327\"\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsharanda%2Fnativebook","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpsharanda%2Fnativebook","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpsharanda%2Fnativebook/lists"}