A tool for defining design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.
Swift HTML OCaml JavaScript Ruby CSS Other
Clone or download
dabbott Merge pull request #164 from airbnb/compile-react-sketch
Support generating code for react-sketchapp
Latest commit 3c5e869 Jun 15, 2018

README.md

Lona (Developer Preview)


This project is still in a very early stage. We don't provide any support of any kind. You shouldn't use this for production unless you really know what you're doing. The API and file format may change without warning as we continue development. There are no automated tests and the code is not yet at the same degree of technical rigor as other Airbnb projects.

Want to get involved? Open a GitHub issue or say hello on Twitter! @dvnabbott

Overview

Build Status

Lona is a collection of tools for building design systems and using them to generate cross-platform UI code, Sketch files, and other artifacts.

Lona consists primarily of 3 parts:

  • Lona Components - A data format, .component, for cross-platform components
  • Lona Studio - A GUI tool for designing .component files
  • Lona Compiler - A CLI tool & API for for generating UI code from .component files

Why Lona? Read more about challenges with cross-platform design systems at scale, and how Lona solves them here.

Lona Components

A design system is defined in JSON as a collection of:

  • Components (can be nested)
  • Colors, Text Styles, Gradients, and Shadows
  • Data Types

The specification for these files can be found in the docs.

Lona Studio

Lona Studio provides a graphical interface for working with .component files.

Lona Studio is primarily for building component systems, but can also be used for:

  • Quickly mocking up new screens from existing components
  • Viewing designs with real data from JSON files or APIs
  • Experimenting with designs across multiple screen sizes
  • Automating design tasks - e.g. localizing screenshots for different languages and exporting hundreds of images
  • Working with animations (Lottie) and rendering videos from them
  • and more!

If you have Xcode installed, you can try it out by following the installation instructions.

Wondering if this replaces Sketch? Why a native Mac App? I answer some common questions here in the FAQ.

Lona Compiler

Lona Compiler converts .component files to UI code for various targets.

Support is planned for:

  • iOS / macOS (Swift)
  • Android (Kotlin)
  • React (JavaScript)

Currently, the only functioning target is Swift, and it's extremely rough. If you still want to try it out, check out the installation instructions.

The Team