# dioxus-hoverfx-core
Serializable configuration for worker-first cursor proximity hover effects.
```rust
use dioxus_hoverfx_core::{
HoverFxConfig, HoverFxDefinition, HoverFxFalloff, HoverFxPreset, HoverFxShape,
};
let config = HoverFxConfig::new()
.with_default_effect(HoverFxPreset::Spotlight.as_attr())
.with_radius_px(220)
.with_shape(HoverFxShape::Circle)
.with_falloff(HoverFxFalloff::Smooth)
.with_strength(1.15)
.with_effect(
HoverFxDefinition::new("brand-wash", "Brand wash")
.with_preset(HoverFxPreset::ColorWash)
.with_css_var("--dxh-color", "rgba(14,165,233,0.30)")
.with_css_var("--dxh-blend-mode", "screen"),
);
assert!(config.validate().is_valid());
let json = serde_json::to_string(&config)?;
# Ok::<(), serde_json::Error>(())
```
Built-in presets are `spotlight`, `soft-glow`, `border-trace`, `sheen`, and
`color-wash`. Defaults are tuned for worker-first rendering: 180px radius,
smooth falloff, 1.0 strength, 0.18 pointer smoothing, and up to 8 active
elements per frame.
## Install
~~~toml
[dependencies]
dioxus-hoverfx-core = "0.1.0-alpha.3"
~~~
## Release Status
- Current crate version: `0.1.0-alpha.3`.
- Release wave: June 8, 2026 workspace integration update.
- Publish status: Prepared as a crates.io update for this package.
- Scope: Serializable worker-first cursor hover effect configuration for Dioxus.
- The README install examples and local workspace dependency requirements are aligned with this publish wave.
## Integration Recipes
Route-level integrations can build one manifest and reuse it across SSR,
Strata-style route metadata, asset-budget reports, and optimizer caches:
```rust
use dioxus_hoverfx_core::prelude::*;
let config = hoverfx().with_default_effect(HoverFxPreset::Spotlight.as_attr());
let policy = hoverfx_route_policy()
.route("/gallery")
.diagnostics(HoverFxDiagnosticVerbosity::Summary)
.fallback(HoverFxFallbackStrategy::StaticCss);
let manifest = hoverfx_manifest_fragment(&config, &policy);
let batch = hoverfx_serialize_batch([(&config, policy.clone())], HoverFxBatchOptions::default())?;
let budget = hoverfx_asset_budget_bridge(&config.output_report(&policy));
let migration = hoverfx_strata_migration_plan(&config, &policy);
assert_eq!(manifest.package, "dioxus-hoverfx");
assert!(batch.total_bytes > 0);
# Ok::<(), serde_json::Error>(())
```
For deterministic build output, use `HoverFxBatchOptions { deterministic_parallel:
true, ..Default::default() }`. `HoverFxRuntimeIds::duplicate_ids` and
`deduped` guard generated script/style ids, `hoverfx_optimizer_artifacts`
returns minifier/cache-friendly hashes, and `hoverfx_workertown_offload_plan`
describes serializable off-main-thread tasks.