yoga-layout
Yoga is a cross-platform layout engine enabling maximum collaboration within your team by implementing an API many designers are familiar with, and opening it up to developers across different platforms.
Last updated 10 years ago by emilsj .
BSD-3-Clause · Repository · Bugs · Original npm · Tarball · package.json
$ npm install yoga-layout 
SYNC missed versions from official npm registry.

yoga-layout

This package provides prebuilt WebAssembly bindings for the Yoga layout engine.

See more at https://yogalayout.dev

Usage

import {Yoga, Align} from 'yoga-layout';

const node = Yoga.Node.create();
node.setAlignContent(Align.Center);

Objects created by Yoga.<>.create() are not automatically garbage collected and should be freed once they are no longer in use.

// Free a config
config.free();

// Free a tree of Nodes
node.freeRecursive();

// Free a single Node
node.free();

Requirements

yoga-layout requires a toolchain that supports ES Modules and top-level await.

If top-level-await is not supported, use the yoga-layout/load entry point instead. This requires to load yoga manually:

import {loadYoga, Align} from 'yoga-layout/load';

const node = (await loadYoga).Node.create();
node.setAlignContent(Align.Center);

Current Tags

  • 3.2.1                                ...           latest (2 years ago)

20 Versions

  • 3.2.1                                ...           2 years ago
  • 3.2.0                                ...           2 years ago
  • 3.1.0                                ...           2 years ago
  • 3.0.4                                ...           3 years ago
  • 3.0.3                                ...           3 years ago
  • 3.0.2                                ...           3 years ago
  • 3.0.1                                ...           3 years ago
  • 3.0.0                                ...           3 years ago
  • 2.0.1                                ...           3 years ago
  • 2.0.0                                ...           3 years ago
  • 2.0.0-beta.2                                ...           3 years ago
  • 2.0.0-beta.1                                ...           3 years ago
  • 1.9.3                                ...           9 years ago
  • 1.9.2                                ...           9 years ago
  • 1.9.0                                ...           9 years ago
  • 1.8.0                                ...           9 years ago
  • 1.6.0                                ...           9 years ago
  • 1.5.0                                ...           10 years ago
  • 1.2.0                                ...           10 years ago
  • 1.0.1                                ...           10 years ago
Maintainers (2)
Downloads
Total 51
Today 0
This Week 0
This Month 25
Last Day 0
Last Week 0
Last Month 0
Dependencies (3)
Dev Dependencies (2)
Dependents (2)

© 2010 - cnpmjs.org x YWFE | Home | YWFE