Component Outputs
This node defines the output interface for custom components.
The Component Outputs node allows you to create dynamic output ports that become the external interface of your component.
The Component Outputs node is used within component definitions to specify which data and signals the component provides to the outside world. It acts as the bridge between internal component logic and external connections.
Usage
The Component Outputs node functions as the output port definition interface:
Dynamic Port Creation
- Visual Port Editor: Use the built-in port editor to create output ports
- Flexible Types: Support for any data type (*) including numbers, strings, objects, arrays, and signals
- Grouping: Organize related ports into logical groups
- Live Updates: Ports update dynamically as you add or remove them
Component Interface Design
When you add a Component Outputs node to your component:
- Define Ports: Use the port editor to create named output ports
- Set Types: Specify appropriate data types for each port
- Organize: Group related outputs for better organization
- Connect: Wire internal component logic to these outputs
Inputs
Dynamic Inputs
The Component Outputs node automatically creates inputs corresponding to each defined output port:
| Data | Description |
|---|---|
| [Port Name] | Input corresponding to each defined output port |
Usage Patterns
Value Propagation
Internal component nodes connect to the Component Outputs node inputs, which then:
- Receive Values: Accept data and signals from internal component logic
- Forward Values: Propagate values to external connections through the component instance
- Maintain State: Preserve output values for external access
- Signal Events: Forward signal events to external listeners
Example Use Cases
-
Custom UI Components: Expose component state and events
Outputs: isActive, onClick, onHover, currentValue
Used by: External systems monitoring component state -
Data Processing Components: Provide processed results
Outputs: processedData, errorStatus, completionSignal
Used by: Downstream data processing stages -
Animation Components: Report animation state and completion
Outputs: currentProgress, onComplete, onStart, finalValue
Used by: Animation sequence coordinators -
Business Logic Components: Return computation results
Outputs: validationResult, calculatedTotal, errorMessages
Used by: Application logic and UI updates
Advanced Features
Signal Forwarding: Forward internal signals to external handlers State Exposure: Expose internal component state for monitoring Event Aggregation: Combine multiple internal events into summary outputs Data Transformation: Process internal data before external exposure
Integration Workflow
- Internal Generation: Component logic generates data or signals
- Output Connection: Internal nodes connect to Component Outputs inputs
- Value Reception: Component Outputs receives and processes values
- External Propagation: Values are forwarded to external connections via component instance
- External Consumption: External nodes receive and process the output values
Best Practices
- Clear Naming: Use descriptive names that clearly indicate the output's purpose
- Type Consistency: Maintain consistent data types across similar components
- Event Semantics: Use clear event naming conventions (onComplete, onError, etc.)
- State Minimization: Only expose necessary internal state
- Documentation: Provide clear descriptions of output behavior
Component Architecture Benefits
Encapsulation: Internal logic details are hidden from external consumers Reusability: Well-defined outputs make components reusable across contexts Testability: Clear output contracts enable component testing Maintainability: Changes to internal logic don't affect external interfaces Modularity: Components can be developed and tested independently
Development Workflow
- Design Interface: Plan what outputs your component should provide
- Add Component Outputs Node: Place the node in your component
- Configure Ports: Use the port editor to define outputs
- Connect Internally: Wire internal component logic to output inputs
- Test Externally: Verify that external connections receive expected values
- Document: Maintain clear documentation of output contracts
Error Handling
- Validation: Validate internal values before outputting
- Error Signals: Provide error outputs for exceptional conditions
- Graceful Degradation: Handle missing or invalid internal values
- Status Reporting: Include status outputs for complex operations
The Component Outputs node is essential for creating well-defined, reusable components with clear external interfaces.