Skip to content

effect-boxes

Compose rectangular text layouts for terminals and HTML with Effect. Place text beside other text, align it, add borders, and apply styling through annotations. All layout operations return new boxes without changing the originals.

Render your first box

Install the library and its Effect 4 peer dependency:

npm install effect-boxes "effect@^4"
import * as Box from "effect-boxes/Box";
 
const greeting = Box.text("Hello, World!");
console.log(Box.renderPlainSync(greeting));
// Hello, World!

Box.renderPlainSync returns a string without setting up an Effect runtime. For styled terminal output, use Box.renderPrettySync.

Choose where to start