{"id":13777398,"url":"https://github.com/lucasbrown/swiftui-visual-effects","last_synced_at":"2025-05-11T11:33:26.950Z","repository":{"id":41896928,"uuid":"267170991","full_name":"lucasbrown/swiftui-visual-effects","owner":"lucasbrown","description":"View modifiers that wrap UIVisualEffectView, with environment integration.","archived":false,"fork":false,"pushed_at":"2020-09-09T16:25:34.000Z","size":29,"stargazers_count":289,"open_issues_count":2,"forks_count":14,"subscribers_count":8,"default_branch":"master","last_synced_at":"2024-08-03T18:11:29.626Z","etag":null,"topics":["apple","ios","swift","swift-library","swift-package","swiftui","uikit"],"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/lucasbrown.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}},"created_at":"2020-05-26T23:10:02.000Z","updated_at":"2024-07-06T22:09:02.000Z","dependencies_parsed_at":"2022-08-11T20:31:36.591Z","dependency_job_id":null,"html_url":"https://github.com/lucasbrown/swiftui-visual-effects","commit_stats":null,"previous_names":[],"tags_count":4,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbrown%2Fswiftui-visual-effects","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbrown%2Fswiftui-visual-effects/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbrown%2Fswiftui-visual-effects/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/lucasbrown%2Fswiftui-visual-effects/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/lucasbrown","download_url":"https://codeload.github.com/lucasbrown/swiftui-visual-effects/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225043121,"owners_count":17411928,"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":["apple","ios","swift","swift-library","swift-package","swiftui","uikit"],"created_at":"2024-08-03T18:00:42.741Z","updated_at":"2024-11-17T13:30:42.218Z","avatar_url":"https://github.com/lucasbrown.png","language":"Swift","funding_links":[],"categories":["Blur"],"sub_categories":["Content"],"readme":"# SwiftUI Visual Effects\n\n\u003cp align=\"center\"\u003e\n  \u003cimg width=\"300\" src=\"https://user-images.githubusercontent.com/49323986/85805691-a2fceb00-b712-11ea-859d-bd0c3d93c878.png\"\u003e\n  \u003cimg width=\"300\" src=\"https://user-images.githubusercontent.com/49323986/85805707-adb78000-b712-11ea-94e6-f88716401a2c.png\"\u003e\n  \u003cbr\u003e\n  System materials in SwiftUI\n\u003c/p\u003e\n\nView modifiers that wrap `UIVisualEffectView` and all of its associated objects, with environment integration for storing effect styles. Vibrancy effects will always use the current blur effect style for proper vibrancy-effect layering.\n\n### Adding and Styling a Blur Effect\n```swift\nYourView()\n  // Add a blur effect.\n  .blurEffect()\n  // Style the blur effect.\n  .blurEffectStyle(.systemChromeMaterial)\n```\n\n### Adding and Styling a Vibrancy Effect\n```swift\nYourView()\n  // Add a vibrancy effect.\n  .vibrancyEffect()\n  // Style the vibrancy effect.\n  .vibrancyEffectStyle(.fill)\n```\n\n### Adding and Styling Blur and Vibrancy Effects\n```swift\nZStack {\n  YourBackgroundContent()\n    // Add a blur effect.\n    .blurEffect()\n\n  YourForegroundContent()\n    // Add a vibrancy effect.\n    .vibrancyEffect()\n}\n// Set the style for blur effects within this view.\n.blurEffectStyle(.systemChromeMaterial)\n// Set the style for vibrancy effects within this view.\n.vibrancyEffectStyle(.fill)\n```\n\n## Adding Blur and Vibrancy Effects Directly to a View\n\nAdding both a blur and vibrancy effect directly to a view only displays the blur effect.\n\nIf you’d like to blur the view’s background content, while adding vibrancy to the view’s foreground content, use the `.background()` modifier, and pass `BlurEffect()` as its argument. Although `BlurEffect` may not be very Apple-like, it’s better than the `.blurEffect()` modifier implementation below.\n\n```swift\nYourView()\n  .vibrancyEffect()\n  .background(BlurEffect())\n\n// as opposed to:\n\nYourView()\n  .vibrancyEffect()\n  .background(\n    Color.clear\n      .blurEffect()\n  )\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasbrown%2Fswiftui-visual-effects","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flucasbrown%2Fswiftui-visual-effects","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flucasbrown%2Fswiftui-visual-effects/lists"}