{"id":15055375,"url":"https://github.com/sherlouk/spangrid","last_synced_at":"2025-06-15T02:03:51.780Z","repository":{"id":46637155,"uuid":"412193404","full_name":"Sherlouk/SpanGrid","owner":"Sherlouk","description":"An enhanced SwiftUI grid.","archived":false,"fork":false,"pushed_at":"2022-06-09T18:01:38.000Z","size":4046,"stargazers_count":8,"open_issues_count":2,"forks_count":2,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-06-15T02:03:06.959Z","etag":null,"topics":["ios","lazyvgrid","snapshot-testing","swift","swift-package-manager","swiftui"],"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/Sherlouk.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2021-09-30T19:10:36.000Z","updated_at":"2024-12-11T15:04:19.000Z","dependencies_parsed_at":"2022-07-20T08:32:02.172Z","dependency_job_id":null,"html_url":"https://github.com/Sherlouk/SpanGrid","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"purl":"pkg:github/Sherlouk/SpanGrid","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlouk%2FSpanGrid","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlouk%2FSpanGrid/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlouk%2FSpanGrid/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlouk%2FSpanGrid/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/Sherlouk","download_url":"https://codeload.github.com/Sherlouk/SpanGrid/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/Sherlouk%2FSpanGrid/sbom","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":259910672,"owners_count":22930703,"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":["ios","lazyvgrid","snapshot-testing","swift","swift-package-manager","swiftui"],"created_at":"2024-09-24T21:41:39.985Z","updated_at":"2025-06-15T02:03:51.758Z","avatar_url":"https://github.com/Sherlouk.png","language":"Swift","funding_links":[],"categories":[],"sub_categories":[],"readme":"# SpanGrid\n\n\u003e SpanGrid is an enriched SwiftUI [`LazyVGrid`](https://developer.apple.com/documentation/swiftui/lazyvgrid) that supports a number of extra features.\n\n\n\u003cpicture\u003e\n  \u003csource srcset=\"https://raw.githubusercontent.com/Sherlouk/SpanGrid/main/Tests/__Snapshots__/SpanGridExampleImageGenerator/testREADME.dark.png\" media=\"(prefers-color-scheme: dark)\"\u003e\n  \u003cimg src=\"https://raw.githubusercontent.com/Sherlouk/SpanGrid/main/Tests/__Snapshots__/SpanGridExampleImageGenerator/testREADME.light.png\" alt=\"A basic example output of a SpanGrid with four cells reading the sentence: Welcome to SpanGrid! The latest in SwiftUI grid goodness.\"\u003e\n\u003c/picture\u003e\n\n\n## Compatibility\n\n* Requires\n    * Xcode 12.5+\n* Supports\n    * 📱 iOS 14+ (including macCatalyst)\n    * 📺 tvOS 14+\n    * ⌚️ watchOS 7+\n    * 💻 macOS 11+\n\n## Features\n\n### Column Span\n\nAll items in the data source must conform to `SpanGridSizeInfoProvider`. This protocol adds a single parameter to your\ndata which informs the grid as to how many columns it should fill.\n\nOptions include:\n* A single `cell` which is the same width as a column.\n* A full `row` which will cover all columns, no matter how many columns there are.\n* A custom `span` which allows you to specify the exact number of columns. If the value provided is larger than the number of columns, then it will fill the row.\n\nIf a cell cannot fit in the remaining space of a row, then it will create a new row leaving whitespace on the previous one.\n\n### Row Size Strategy\n\nWhen returning your custom view for each cell, it will arrive with a metadata model. This model will include information\nsuch as the calculated height of the row. This value may also be `nil` in scenarios where we have yet to calculate it.\n\nOptions include:\n* A `fixed` size where all rows will be the same height that you have provided.\n* `square` where the height of each row is the same as the width of a single column. If your row contains a span of \u003e1, it will still only return the width of a single column.\n* `largest` will return the height of the largest cell in the row allowing for all cells to be of equal height.\n* `none` (default) will never return a height.\n\n### Column Size Strategy\n\nThe width of a single column, the number of columns and the space between columns can be calculated in a number of ways.\n\nOptions include:\n* A `fixed` provider which allows you to strictly specify the three values above.\n* `dynamic` (default) provides an opinionated column structure which adapts to the size of the device and includes some accessibility changes.\n* `custom` allows you to provide your own implementation. This will provide you with the current width of the grid. \n\n### Keyboard Navigation (Opt-in)\n\nThis allows users to navigate through rows/items using an attached keyboard (iPadOS).\n\n\u003e Due to an Apple limitation, we currently use WASD keys rather than arrow keys. We hope this'll change in the future.\n\nWhen instantiating the SpanGrid, you can pass through keyboard navigation options which includes turning on the feature,\nas well as turning on/off keyboard discoverability and the localized strings shown to users (default English only strings \nare provided).\n\n## Notes\n\nI do not pledge to be an expert in SwiftUI, so there may be many issues with the current implementation. I have tested it\nthe best I can and have seen no real issues with performance or functionality. Feel free to raise issues or pull requests\nwith enhancements, bug fixes, ideas, etc.\n\nNo Jordan, this project is **not** called Spandex, no matter how many times you say it.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherlouk%2Fspangrid","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsherlouk%2Fspangrid","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsherlouk%2Fspangrid/lists"}