Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/lukepistrol/masonrystack
A Pinterest like layout in SwiftUI (horizontal & vertical).
https://github.com/lukepistrol/masonrystack
layout masonry-grid masonry-layout swift swiftui swiftui-components
Last synced: about 1 month ago
JSON representation
A Pinterest like layout in SwiftUI (horizontal & vertical).
- Host: GitHub
- URL: https://github.com/lukepistrol/masonrystack
- Owner: lukepistrol
- License: mit
- Created: 2023-08-25T17:50:26.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2023-09-16T18:41:50.000Z (about 1 year ago)
- Last Synced: 2024-10-12T18:02:44.263Z (about 1 month ago)
- Topics: layout, masonry-grid, masonry-layout, swift, swiftui, swiftui-components
- Language: Swift
- Homepage:
- Size: 13.7 KB
- Stars: 142
- Watchers: 5
- Forks: 4
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# MasonryStack
A Pinterest like layout in SwiftUI (horizontal & vertical).
https://github.com/lukepistrol/MasonryStack/assets/9460130/db3d0914-672d-4f53-8681-c28b8423994a
## Usage
> **Note**
> At this point this does not support lazy loading. Keep this in mind when displaying large amounts of data.The `MasonryHStack` and `MasonryVStack` can be used just like `HStack` or `VStack`:
```swift
import SwiftUI
import MasonryStackstruct ContentView: View {
var body: some View {
MasonryVStack(columns: 2, spacing: 20) {
// ...
}
}
}
```Both stacks conform to the `Layout` protocol so you can easily switch between other layouts as well.
-----