Skip to content

Text

widgetsdisplay

Text: renders a string of text with word-wrapping, alignment, and scrolling

Installation

$ bunx termuijs add text

Copies the source into src/components/text/ and installs @termuijs/core, @termuijs/widgets.

Usage

ts
import { Text } from '@termuijs/widgets'
ts
new Text(content: string, style: Partial<Style> = {}, props: Partial<TextProps> = {})

API Reference

Text

PropTypeRequiredDescription
contentstringrequired
contentstringrequired
wrapbooleanoptional
align'left' | 'center' | 'right'optional
scrollYnumberoptionalVertical scroll offset (lines to skip from top)
scrollXnumberoptionalHorizontal scroll offset (columns to skip from left)
#display#text