Fundamental container with border, label and layout options.
npm run tsx:core-gallery
Property | Type | Required | Default | Description |
---|---|---|---|---|
content | string | No | - | Initial content text for the box |
label | string | No | - | Label text displayed in border (from component-schemas) |
scrollable | boolean | No | - | Enable scrolling functionality |
alwaysScroll | boolean | No | - | Always show scroll indicators (from component-schemas) |
scrollableOptions | ScrollableOptions | No | - | Advanced scrolling configuration |
BasePropsSchema
and includes all standard TUI component properties:
Property | Type | Default | Description |
---|---|---|---|
parent | blessed.Widgets.Node | - | Parent blessed element |
className | string | - | CSS-like class name for styling |
id | string | - | Unique identifier |
variant | ComponentVariant | "default" | Component variant (primary, secondary, etc.) |
size | ComponentSize | - | Component size (xs, sm, md, lg, xl) |
disabled | boolean | false | Whether component is disabled |
hidden | boolean | false | Whether component is hidden |
focusable | boolean | true | Whether component can receive focus |
scrollable | boolean | false | Whether component is scrollable |
Property | Type | Description |
---|---|---|
top | TerminalUnit | Top position (number, percentage, or alignment) |
left | TerminalUnit | Left position |
right | TerminalUnit | Right position |
bottom | TerminalUnit | Bottom position |
width | TerminalUnit | Component width |
height | TerminalUnit | Component height |
padding | PaddingConfig | Internal spacing |
margin | PaddingConfig | External spacing |
Property | Type | Description |
---|---|---|
bg | ColorValue | Background color |
fg | ColorValue | Foreground color |
border | BorderStyle | Border configuration |
borderColor | ColorValue | Border color |
borderStyle | "line" | "double" | "round" | "bold" | "classic" | "none" | Border style helper |
style | TextStyle | Text styling (bold, underline, etc.) |
animation | AnimationType | Animation type |
Method | Parameters | Return Type | Description |
---|---|---|---|
setContent | content: string | void | Sets content with stable width management (streaming-friendly) |
destroy | - | void | Cleanup method from base component |
Method | Parameters | Return Type | Description |
---|---|---|---|
setVariant | variant: ComponentVariant | void | Updates component variant |
setSize | size: ComponentSize | void | Updates component size |
setState | state: ComponentState | void | Updates component state |
getConfig | - | ComponentConfig | Returns current configuration |
update | props: Partial<BoxProps> | void | Updates component properties |
Method | Parameters | Return Type | Description |
---|---|---|---|
Box.create | props: BoxProps | Box | Factory method to create new box instance |
label
for semantic section titles; combine with Heading
for in-content titles.