Expand description
Action system for HyperChad UI framework
This crate provides a comprehensive action system for building interactive UI behaviors
in the HyperChad framework. It enables declarative definition of UI actions triggered by
events such as clicks, hovers, and HTTP requests.
§Main Components
Action- Combines a trigger event with an effect to executeActionTrigger- Event types that can trigger actions (click, hover, HTTP events, etc.)ActionEffect- Wrapper for actions with timing modifiers (throttle, delay)ActionType- Concrete action types (style changes, navigation, logging, custom actions)Key- Keyboard key representations for key events
§Feature Flags
logic- Enables conditional logic and dynamic value evaluation in actionshandler- Provides action handler implementation for processing actionsarb- Adds property-based testing support viaproptestserde- Enables serialization/deserialization support
§Example
use hyperchad_actions::{Action, ActionTrigger, ActionType};
use hyperchad_transformer_models::Visibility;
// Create an action that hides an element when clicked
let action = Action {
trigger: ActionTrigger::Click,
effect: ActionType::hide_by_id("my-element").into(),
};Modules§
- arb
- Arbitrary value generation for property-based testing Arbitrary value generation for property-based testing
- dsl
- Domain-specific language (DSL) for defining actions in templates
DSL AST for
HyperChadActions - handler
- Action handler implementation for processing and executing actions Action handler implementation for processing and executing actions
- logic
- Logic and conditional evaluation for actions Conditional logic and dynamic value evaluation for actions
- prelude
- Convenience re-exports for common action APIs.
Structs§
- Action
- Action that combines a trigger event with an effect
- Action
Effect - Effect that wraps an action with timing and execution modifiers
- Http
Event Context - Context information for HTTP-related action events
Enums§
- Action
Trigger - Event trigger that determines when an action should execute
- Action
Type - Types of actions that can be performed on UI elements
- Element
Target - Target specification for DOM element selection.
- Input
Action Type - Input-related action types
- Key
- Keyboard key representation for key events
- LogLevel
- Log severity level for logging actions
- Style
Action - Style modification actions for UI elements
- Target
- A target reference that can be either a literal string or a reference to a value.