Raxol.Protocols.ComponentFramework (Raxol v2.0.1)
View SourceProtocol-based component framework for Raxol.
This module provides a modern, protocol-driven approach to building UI components that can be rendered, styled, and handle events in a unified way.
Key Features
- Protocol-based composition for maximum flexibility
- Automatic protocol implementation injection
- Theme and style management integration
- Event handling with bubbling and propagation
- Performance optimizations through protocol dispatch
Usage
defmodule MyComponent do
use Raxol.Protocols.ComponentFramework
defcomponent :my_widget do
@props [:title, :content, :style]
@events [:click, :change]
@themeable true
def render(component, opts) do
# Component rendering logic
end
end
end
Summary
Functions
Macro executed before compilation to inject protocol implementations.
Macro for defining protocol-aware components.
Add a child component to a parent component.
Add multiple children to a component.
Apply a theme to a component and all its children.
Create a component with the given type and properties.
Set an event handler for a component.
Update component props.
Update component state.
Functions
Macro executed before compilation to inject protocol implementations.
Macro for defining protocol-aware components.
Add a child component to a parent component.
Add multiple children to a component.
Apply a theme to a component and all its children.
Create a component with the given type and properties.
Set an event handler for a component.
Update component props.
Update component state.