{"id":13872189,"url":"https://github.com/square/Blueprint","last_synced_at":"2025-07-16T01:33:13.166Z","repository":{"id":34402693,"uuid":"178483312","full_name":"square/Blueprint","owner":"square","description":"Declarative UI construction for iOS, written in Swift","archived":false,"fork":false,"pushed_at":"2024-11-21T15:12:32.000Z","size":14031,"stargazers_count":672,"open_issues_count":18,"forks_count":44,"subscribers_count":20,"default_branch":"main","last_synced_at":"2024-11-21T16:23:59.698Z","etag":null,"topics":["declarative","declarative-ui","square","swift","ui","uikit"],"latest_commit_sha":null,"homepage":"https://square.github.io/Blueprint/","language":"Swift","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/square.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":".github/CODEOWNERS","security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2019-03-29T22:30:48.000Z","updated_at":"2024-11-04T22:44:53.000Z","dependencies_parsed_at":"2023-12-05T18:40:24.573Z","dependency_job_id":"d04d54f0-8207-4379-9864-abfb7cf7d2b6","html_url":"https://github.com/square/Blueprint","commit_stats":{"total_commits":695,"total_committers":44,"mean_commits":"15.795454545454545","dds":0.7597122302158273,"last_synced_commit":"c333c858925d2da811310e5243e1f19b20546795"},"previous_names":[],"tags_count":87,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2FBlueprint","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2FBlueprint/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2FBlueprint/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/square%2FBlueprint/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/square","download_url":"https://codeload.github.com/square/Blueprint/tar.gz/refs/heads/main","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":225762176,"owners_count":17520271,"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":["declarative","declarative-ui","square","swift","ui","uikit"],"created_at":"2024-08-05T23:00:36.169Z","updated_at":"2025-07-16T01:33:13.154Z","avatar_url":"https://github.com/square.png","language":"Swift","funding_links":[],"categories":["Swift"],"sub_categories":[],"readme":"# Blueprint\n\n[![Tests](https://github.com/square/Blueprint/actions/workflows/tests.yaml/badge.svg)](https://github.com/square/Blueprint/actions/workflows/tests.yaml)\n[![Generate and publish docs](https://github.com/square/Blueprint/actions/workflows/docs.yml/badge.svg)](https://github.com/square/Blueprint/actions/workflows/docs.yml)\n[![Linter](https://github.com/square/Blueprint/actions/workflows/lint.yml/badge.svg)](https://github.com/square/Blueprint/actions/workflows/lint.yml)\n\n## Declarative UI construction for iOS, written in Swift\n\nBlueprint greatly simplifies the task of building and updating views as application state changes.\n\n```swift\nlet view = BlueprintView(element: Label(text: \"Hello from Blueprint!\"))\n```\n\n### What does this library do?\n\nBlueprint provides an architecture that allows you to:\n- Declaratively define a UI hierarchy as pure values (Swift structs and enums).\n- Display that hierarchy within your application.\n- Update that hierarchy as application state changes (including animated transitions).\n\n### When should I use it?\n\nUse Blueprint any time you want to display a view hierarchy, but don't want to manage view lifecycle (hint: managing view lifecycle is a large portion of most conventional UIKit code). There are times when you *want* to manage view lifecycle (complex animations and transitions are a good example), and for these cases you may want to stick with a conventional approach.\n\n### How does it interact with UIKit?\n\nBlueprint is not a replacement for UIKit! From the beginning, Blueprint has been designed as a compliment to all of the powerful tools that come with the platform. You can use Blueprint to manage the display of a single view controller, or of a single view representing a small part of the screen. Likewise, it's straightforward to host standard views and controls *within* a blueprint hierarchy, always leaving you with an escape hatch.\n\n### How does it interact with SwiftUI?\n\nThey serve similar purposes, and SwiftUI has heavily influenced Blueprint's API. However, Blueprint predates SwiftUI, and works a bit differently. You can host a `BlueprintView` in SwiftUI to embed Blueprint within SwiftUI, and you can also use the provided `ElementView` to create Xcode previews of Blueprint. Because SwiftUI is hosted by a UIViewController, and Blueprint is hosted in a UIView, we don't provide a way to embed SwiftUI within Blueprint.\n\n## Getting Started\n\n### Swift Package Manager\n\n[![SwiftPM compatible](https://img.shields.io/badge/SwiftPM-compatible-orange.svg)](#swift-package-manager)\n\nIf you are developing your own package, be sure that Blueprint is included in `dependencies`\nin `Package.swift`:\n\n```swift\ndependencies: [\n    .package(url: \"https://github.com/square/Blueprint\", from: \"5.1.0\")\n]\n```\n\nIn Xcode 11+, add Blueprint directly as a dependency to your project with\n`File` \u003e `Swift Packages` \u003e `Add Package Dependency...`. Provide the git URL when prompted: `git@github.com:square/Blueprint.git`.\n\nTwo modules are provided:\n- `BlueprintUI` contains the core architecture and layout types.\n- `BlueprintUICommonControls` includes elements representing some common `UIKit` views and controls.\n\n## Documentation\n\nAPI documentation is available at [square.github.io/Blueprint](https://square.github.io/Blueprint/)\n\n### Getting Started\n\n1.  **[Hello, World](Documentation/GettingStarted/HelloWorld.md)**\n\n1.  **[The Element Hierarchy](Documentation/GettingStarted/ElementHierarchy.md)**\n\n1.  **[Building Custom Elements](Documentation/GettingStarted/CustomElements.md)**\n\n1.  **[Layout](Documentation/GettingStarted/Layout.md)**\n\n\n### Reference\n\n1.  **[`Element`](Documentation/Reference/Element.md)**\n\n1.  **[`BlueprintView`](Documentation/Reference/BlueprintView.md)**\n\n1.  **[`ViewDescription`](Documentation/Reference/ViewDescription.md)**\n\n1.  **[Transitions](Documentation/Reference/Transitions.md)**\n\n\n### Tutorials\n\n[Tutorial setup instructions](Documentation/Tutorials/Setup.md)\n\n1. **[Using Blueprint in a View Controller](Documentation/Tutorials/Tutorial1.md)**\n\n1. **[Building a receipt layout with Blueprint](Documentation/Tutorials/Tutorial2.md)**\n\n## Local Development\n\nThis project uses [Mise](https://mise.jdx.dev/) and [Tuist](https://tuist.io/) to generate a project for local development. Follow the steps below for the recommended setup for zsh.\n\n```sh\n# install mise\nbrew install mise\n# add mise activation line to your zshrc\necho 'eval \"$(mise activate zsh)\"' \u003e\u003e ~/.zshrc\n# load mise into your shell\nsource ~/.zshrc\n# tell mise to trust Blueprint's config file\nmise trust\n# install dependencies\nmise install\n\n# only necessary for first setup or after changing dependencies\ntuist install --path SampleApp\n# generates and opens the Xcode project\ntuist generate --path SampleApp\n```\n\n---\n\nCopyright 2019 Square, Inc.\n\nLicensed under the Apache License, Version 2.0 (the \"License\");\nyou may not use this file except in compliance with the License.\nYou may obtain a copy of the License at\n\nhttp://www.apache.org/licenses/LICENSE-2.0\n\nUnless required by applicable law or agreed to in writing, software\ndistributed under the License is distributed on an \"AS IS\" BASIS,\nWITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\nSee the License for the specific language governing permissions and\nlimitations under the License.\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2FBlueprint","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fsquare%2FBlueprint","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fsquare%2FBlueprint/lists"}