Basic text display with markup and alignment.
npm run tsx:core-gallery
Property | Type | Required | Default | Description |
---|---|---|---|---|
content | string | Yes | - | Text content to display (min 1 character) |
align | "left" | "center" | "right" | No | "left" | Text alignment |
wrap | boolean | No | false | Enable text wrapping |
shrink | boolean | No | - | Shrink text to fit (from component-schemas) |
bold | boolean | No | false | Apply bold styling |
italic | boolean | No | false | Apply italic styling |
underline | boolean | No | false | Apply underline styling |
blink | boolean | No | - | Apply blink styling (from component-schemas) |
BasePropsSchema
and includes all standard TUI component properties:
Property | Type | Default | Description |
---|---|---|---|
parent | blessed.Widgets.Node | - | Parent blessed element |
variant | ComponentVariant | "default" | Component variant |
size | ComponentSize | - | Component size |
bg | ColorValue | - | Background color |
fg | ColorValue | - | Foreground color |
borderStyle | "line" | "double" | "round" | "bold" | "classic" | "none" | "none" | Border style (defaults to none) |
Method | Parameters | Return Type | Description |
---|---|---|---|
setText | text: string | void | Updates the text content with ANSI sanitization |
destroy | - | void | Cleanup method from base component |
Method | Parameters | Return Type | Description |
---|---|---|---|
Text.create | props: TextProps | Text | Factory method to create new text instance |