Latest 1.0.1
License MIT
Platforms ios 9.3

CSSLayout is a tiny Swift wrapper around Facebook’s css-layout framework.

Basic Usage

Imagine a simple UIView, with two subviews (represented as containerNode, childNode and otherChildNode below).

let containerNode = CSSNode(flexDirection: CSSFlexDirectionColumn, alignItems: CSSAlignCenter)
let childNode = CSSNode(size: CSSSize(width: 50, height: 50))
let otherChildNode = CSSNode(alignSelf: CSSAlignStretch)
containerNode.children = [childNode, otherChildNode]

let computedLayout = containerNode.layout()

// At this point, computedLayout can be used to set the frames of the views represented by these nodes.
container.frame = computedLayout.frame
child.frame = computedLayout.children[0].frame
otherChild.frame = computedLayout.children[1].frame

Latest podspec

    "name": "CSSLayout",
    "version": "1.0.1",
    "summary": "Swift wrapper around Facebook's css-layout.",
    "description": "CSSLayout is a tiny Swift wrapper around Facebook's css-layout framework.",
    "homepage": "",
    "license": "MIT",
    "authors": {
        "Matias Cudich": "[email protected]"
    "source": {
        "git": "",
        "tag": "1.0.1",
        "submodules": true
    "social_media_url": "",
    "platforms": {
        "ios": "9.3"
    "source_files": [
    "pushed_with_swift_version": "3.0"

Pin It on Pinterest

Share This