Getting started

Installation

npm install effect-boxes effect

Basic usage

import * as Box from "effect-boxes/Box";
import { pipe } from "effect";
 
// Create a simple text box
const hello = Box.text("Hello, World!");
 
// Render to string
console.log(Box.render(hello));
// Hello, World!

Composition

Boxes compose horizontally and vertically:

const row = Box.hcat([Box.text("Left"), Box.text("Right")], Box.top);
const col = Box.vcat([Box.text("Top"), Box.text("Bottom")], Box.left);

All operations are pure: they return new boxes without mutating the originals.

Next steps