yoga-wasm
TypeScript icon, indicating that this package has built-in type declarations

0.0.2 • Public • Published

yoga-wasm

yoga-wasm is a build of Facebook's Yoga Flexbox layout engine, for JavaScript and WebAssembly.

It is a drop in replacement for the yoga-layout NPM package.

Installation

# npm 
npm install --save yoga-wasm
 
# yarn 
yarn add yoga-wasm

Usage

You should be able to use yoga-wasm in the same way you would normally use yoga-layout:

import * as yoga from "yoga-wasm";
 
const node = yoga.Node.create();
 
node.setMaxWidth(100);
 
node.computeLayout(100, 100, yoga.DIRECTION_LTR);

Prior Art

yoga-dom is another attempt to port Yoga to JS with WebAssembly. I leaned heavily on viankakrisna's embind bindings when porting the latest version of Yoga's bindings from nbind to embind.

Contributing

Open a PR or file an issue!

Package Sidebar

Install

npm i yoga-wasm

Weekly Downloads

5

Version

0.0.2

License

MIT

Unpacked Size

304 kB

Total Files

9

Last publish

Collaborators

  • rickbutton