Phonebook: a Storybook-style preview gallery for SwiftUI and Compose
说明与用途
Phonebook 自动收集移动应用中的 @Preview / #Preview 注解,并生成静态 HTML 画廊,让设计师、PM 和 QA 在无需 IDE 的情况下查看所有 UI 状态。
问题
Designers, PMs, and QA often need to view all UI states (enabled/disabled, dark mode, empty, loading) but native preview tools are confined to the developer IDE and cannot be easily shared.
结果
Phonebook turns existing mobile UI previews into a shareable, static gallery, eliminating the need for separate Storybook setups or external screenshot services.
工作流
- 1. Add phonebook.config.json to the project root specifying appName, platform, and Android modules/variant or iOS settings.
- 2. Run
phonebook generate phonebook buildon CI or locally;generaterenders previews using Robolectric/Roborazzi and outputs a bundle (manifest.json, images). - 3.
buildconsumes the bundle and writes a plain static site (index.html, assets). - 4. Deploy the generated folder to GitHub Pages, S3, Netlify, or any static host, or open it locally.
- 5. Stakeholders view the gallery to inspect all UI states without needing IDEs or debug builds.
证据
Phonebook has two main commands: phonebook generate phonebook build
Phonebook does not care. You can open it from file://. You can upload it to GitHub Pages.
- 记录日期: 2026-09-09T08:31:21.320Z