Component Library
Termina provides a set of built-in layout nodes (components) for building terminal UIs. Each component handles a specific rendering concern and can be composed together.
Display Components
| Component | Description |
|---|---|
| TextNode | Renders styled text with word wrapping |
| PanelNode | Bordered container with title |
| SpinnerNode | Animated loading indicator |
| StreamingTextNode | Streaming text with scrolling |
Input Components
| Component | Description |
|---|---|
| TextInputNode | Single-line text input with cursor |
| SelectionListNode | Interactive list selection with keyboard navigation |
Container Components
| Component | Description |
|---|---|
| ScrollableContainer | Vertical scrolling container |
| StackLayout | Overlapping children (z-stack) |
| ModalNode | Modal overlay with backdrop |
Reactive Components
| Component | Description |
|---|---|
| ReactiveLayoutNode | Updates content from observables |
| ConditionalNode | Show/hide based on condition |
Utility Components
| Component | Description |
|---|---|
| EmptyNode | Placeholder that renders nothing |
| DeferredNode | Delegates to node without owning it |
Common Patterns
All components inherit from LayoutNode and share common methods:
csharp
// Size constraints
node.Height(3); // Fixed height
node.Width(40); // Fixed width
node.Fill(); // Fill remaining height
node.WidthFill(); // Fill remaining width
node.HeightAuto(); // Auto-size to content
node.Width(SizeConstraint.Percent(50)); // Percentage
// Get constraint object for custom use
node.HeightConstraint = SizeConstraint.Fill(weight: 2);Creating Custom Components
See the Custom Components guide for building your own layout nodes.