Exhibition
Exhibition is a framework and generator for displaying a SwiftUI component library.
Inspired by Storybook and Showkase
Installation
Swift Package Manager
Usage
- Add Exhibition to your project via Swift package manager using
https://github.com/mjarvis/Exhibition.git
- Install Sourcery
- Copy Exhibition.swifttemplate into your project
- Modify your SwiftUI previews to use
ExhibitProvider
import Exhibition struct Foo_Previews: ExhibitProvider, PreviewProvider { static var exhibit = Exhibit(name: "Foo") { parameters in Foo( title: parameters.constant(name: "title", defaultValue: "Title"), content: parameters.binding(name: "content") ) .previewLayout(.sizeThatFits) } }
- Run
Sourcery
to generate your Exhibition:sourcery --sources Your/Source/Path --templates Exhibition.swifttemplate --output ./Sources/Generated
- Show
exhibition
in a swift view
TODO:
-
Debug (#1)
- Dark mode (#1)
- RTL
- Text sizing
- Investigate other assistive switches
-
Search (#2)
- Search top level
- Search nested
-
Sections (#5)
- Collapsing
- Rows
- Icon
- Title
-
Element
-
Push
-
Present
-
Layout rules (#4)
-
Parameters (#3)
-
Code samples (copy-able snippets)
-
Code documentation (jazzy / swiftdocc)
-
-
Layout
- iPhone
- iPad
- macOS
- watchOS
- tvOS
Metadata?