Calzini Components and Updates
Calzini is Scarpeās component system, providing a modern approach to UI components while maintaining Shoes compatibility.
Component Structure
Components in Calzini follow this structure:
- Base Components
- Built-in widgets (Button, EditLine, etc.)
- Layout components (Stack, Flow)
- Custom components
- Component Lifecycle
```ruby
class CalziniComponent
def initialize
setup_state
register_handlers
end
def update
calculate_layout
trigger_display_update
end
end
```
State Management
Components manage state through:
- Internal State
- Local component state
- Cached calculations
- Temporary values
- External State
- Props from parent components
- Global application state
- Shared resources
Update Mechanism
Updates in Calzini happen through:
- Change Detection
- State changes trigger updates
- Props changes propagate
- Layout changes cascade
- Update Process
- Changes are batched
- Updates are scheduled
- Display is refreshed efficiently
Best Practices
When working with Calzini components:
- Keep components focused and small
- Use proper state management
- Optimize update triggers
- Handle errors gracefully
Shoes Compatibility
Calzini maintains compatibility with Shoes:
- Similar API structure
- Familiar component names
- Compatible event handling
- Consistent behavior