| title | Installation |
|---|---|
| sidebar_position | 1 |
npm install taffy-layout- Node.js: Version 12 or higher.
- Browser: Modern browser with WebAssembly support:
- Chrome 57+
- Firefox 52+
- Safari 11+
- Edge 16+
Using Taffy in the browser via ES Modules:
<script type="module">
import {
loadTaffy,
TaffyTree,
} from "https://cdn.jsdelivr.net/npm/taffy-layout/dist/index.js";
// 1. Initialize WebAssembly (Required)
await loadTaffy();
// 2. Start using Taffy
const tree = new TaffyTree();
</script>Using Taffy in a Node.js environment:
import { loadTaffy, TaffyTree } from "taffy-layout";
// 1. Initialize WebAssembly (Required)
await loadTaffy();
// 2. Start using Taffy
const tree = new TaffyTree();Taffy Layout includes complete TypeScript definitions out of the box. No additional installation (like @types/taffy-layout) is needed. You get full Intellisense for Style, Layout, and TaffyTree.
- 👉 Quick Start Guide - Create your first Taffy layout.
- 📖 API Reference - View the full API documentation.