Need help with Blueprint?
Click the “chat” button below for chat support from the developer who created it, or find similar developers for support.

About the developer

569 Stars 40 Forks Apache License 2.0 760 Commits 23 Opened issues


Declarative UI construction for iOS, written in Swift

Services available


Need anything else?

Contributors list

Build Status


Declarative UI construction for iOS, written in Swift

Blueprint greatly simplifies the task of building and updating views as application state changes.

We still consider Blueprint experimental (and subject to major breaking API changes), but it has been used within Square's production iOS apps.

let rootElement = Label(text: "Hello from Blueprint!")
let view = BlueprintView(element: rootElement)

Generated documentation is available at

Getting Started

Swift Package Manager

SwiftPM compatible

If you are developing your own package, be sure that Blueprint is included in

dependencies: [
    .package(url: "[email protected]:square/Blueprint.git", from: "0.3.0")

In Xcode 11+, add Blueprint directly as a dependency to your project with

Swift Packages
Add Package Dependency...
. Provide the git URL when prompted:
[email protected]:square/Blueprint.git


CocoaPods compatible

If you use CocoaPods to manage your dependencies, simply add BlueprintUI and BlueprintUICommonControls to your Podfile:

pod 'BlueprintUI'
pod 'BlueprintUICommonControls'

What does this library do?

Blueprint provides an architecture that allows you to: - Declaratively define a UI hierarchy as pure values (Swift structs and enums). - Display that hierarchy within your application. - Update that hierarchy as application state changes (including animated transitions).

When should I use it?

Use 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.

How does it interact with

Blueprint 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.


Getting Started

  1. Hello, World

  2. The Element Hierarchy

  3. Building Custom Elements

  4. Layout


  1. Element

  2. BlueprintView

  3. ViewDescription

  4. Transitions


Tutorial setup instructions

  1. Using Blueprint in a View Controller

  2. Building a receipt layout with Blueprint

Adding Blueprint to an existing project

Two modules are provided: -

contains the core architecture and layout types. -
includes elements representing some common

views and controls.

Blueprint is available via CocoaPods. Add it to your

to integrate:
target MyTarget do
    pod 'BlueprintUI'
    pod 'BlueprintUICommonControls'

Release instructions

Copyright 2019 Square, Inc.

Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except in compliance with the License. You may obtain a copy of the License at

Unless required by applicable law or agreed to in writing, software distributed under the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the License for the specific language governing permissions and limitations under the License.

We use cookies. If you continue to browse the site, you agree to the use of cookies. For more information on our use of cookies please see our Privacy Policy.