Canvas
display
A raw Canvas widget providing a HTML5-like 2D drawing context for custom rendering
Terminal
$termuijs render canvas
Installation
$ bunx termuijs add canvas
Copies the source into src/components/canvas/ and installs @termuijs/core, @termuijs/widgets.
Usage
ts
import { Canvas } from '@termuijs/widgets'ts
new Canvas(style: Partial<Style> = {})API Reference
Canvas
| Prop | Type | Default | Description |
|---|---|---|---|
children | ReactNode | required | Content to render |
style | Styles | {} | Ink style object |
width | number | string | — | Fixed width in columns |
height | number | — | Fixed height in rows |