Ranvier.Anime
0.3.0
dotnet add package Ranvier.Anime --version 0.3.0
NuGet\Install-Package Ranvier.Anime -Version 0.3.0
<PackageReference Include="Ranvier.Anime" Version="0.3.0" />
<PackageVersion Include="Ranvier.Anime" Version="0.3.0" />
<PackageReference Include="Ranvier.Anime" />
paket add Ranvier.Anime --version 0.3.0
#r "nuget: Ranvier.Anime, 0.3.0"
#:package Ranvier.Anime@0.3.0
#addin nuget:?package=Ranvier.Anime&version=0.3.0
#tool nuget:?package=Ranvier.Anime&version=0.3.0
Ranvier.Anime
A .NET port of anime.js 4.5 for Ranvier hosts. It runs on a Ranvier FrameScheduler, writes
through Ranvier.Dom and Ranvier.Css, is reflection-free and compiles under NativeAOT.
The same API is available in the browser as Fable.Ranvier.Anime, over the anime.js npm package. Code written against
the portable surface below compiles unchanged for either.
Host setup and native playback
Install the host's services once, on the host thread, before anything animates:
open Ranvier.Anime
let install (host: WebCoreHost) =
AnimeHost.Install { Scheduler = Frames.forHost host; Computed = ComputedStyles.forHost host }
Then animate. No scheduler appears in a portable call; the functions read the installed host.
Use Spring(bounce = 0.5).Stretch(600.) to keep the spring's curve while fitting a playback interval in milliseconds.
Spring durations and layout options use physical milliseconds. Animation.animateSpring converts the settling duration
to the scheduler's time unit. When supplying a duration directly to a composed animation, pair spring.Ease with
spring.SettlingDuration in milliseconds mode or spring.SettlingDuration / 1000. in seconds mode.
The engine and playback controllers report DeltaTime in their engine's time unit. Draggable and scroll velocities
use CSS pixels per engine time unit. Pass a timer's delta to Utils.dampInUnit engine.TimeUnit start finish delta factor.
The standalone Utils.damp accepts milliseconds.
Use ComposedAnimationOptions.Default.WithMuted(true) to start an animation silently, or pass muted = true
to an individual property spec. Set animation.Muted <- false to resume output from its advancing playhead.
An endpoint reached while muted sets Completed and skips completion notification.
Colour animation endpoints accept modern CSS colour strings. To inspect the converted channels or compose work
after playback, use Utils.parseColor and Completion:
let channels = Utils.parseColor "oklch(65% 0.15 270 / 80%)"
let elapsed (animation: ComposedAnimation) =
Completion.thenResult animation (fun finished -> finished.Duration)
let playNext (intro: ComposedAnimation) (outro: ComposedAnimation) =
Completion.thenAsync intro (fun _ ->
outro.Play() |> ignore
Completion.instance outro)
Native completion returns a .NET task. Use Revert(false) to restore a composed animation's properties
without first seeking to the start. A property claimed by a newer animation keeps its current value.
The portable surface
open Ranvier.Anime
open Ranvier.Anime.Dom
let appear (el: Element) : ComposedAnimation =
Anime.animate
(box el)
[| PropertySpec.Scalar ("opacity", 1., fromValue = 0.); PropertySpec.Scalar ("y", 0., fromValue = 12.) |]
{ ComposedAnimationOptions.Default with Duration = 240.; Ease = Ease.named "outQuad" }
| Area | Names |
|---|---|
| Contracts | IRevertible, ITickable |
| Animations | Anime.animate, Anime.animateTargets, Anime.timeline, PropertySpec, ComposedAnimationOptions, ComposedAnimation, ComposedTimeline, TimelinePosition |
| Easing | Ease.named, Ease.cubicBezier, Ease.steps |
| Following a value | Follow.property, Follow.css, Follow.draw, Follow.morph |
| Layout | Flip.create, Flip.keepBox, Flip.children, LayoutOptions |
| Scroll | Scroll.observe, ScrollOptions, ScrollSync, ScrollEvent |
| Drag | Drag.create, NativeDraggableOptions, NativeDraggable |
| Text | Text.split, TextSplitterOptions, TextSplitter |
| Reactive | Reactive.policy, Reactive.own |
| DOM | Ranvier.Anime.Dom aliases, DomKit, NodeSet |
Scroll.observe and Drag.create need the host's input, resize and viewport services: use the AnimeHost.Install
overload taking AnimeInteractionServices.
Build option records from their defaults, naming only the fields you change:
{ ComposedAnimationOptions.Default with Duration = 300. }. Fields that exist on one engine only (Computed,
Registry and Playback here; Unit and Extra in the browser) are not portable.
The native API
Everything the port has beyond the portable surface takes its scheduler explicitly and stays available:
Timer,Timeline,NumericAnimationandNumericPropertyhandles, withPlaybackOptionsfor repeat, direction, speed and callbacks;Keyframes,KeyframeandKeyframeSequencefor numeric and typed CSS keyframes, sparse rows and offsets;CssAnimationandAnimatablefor typedRanvier.Cssdeclarations and retargetable handles;Composed.animateandComposed.createTimeline, the scheduler-first forms ofAnime.*;Layout,ScrollContainerRegistry,NativeDraggable,Svg,Text,Waapi,Scope,Engine,Stagger,SpringandUtils.
Objects created under a Ranvier owner are reverted when it is disposed; Timer.own, Timeline.own and
Reactive.own attach one explicitly.
Open Ranvier.Anime.ComposedTimelineDsl to build a paused ComposedTimeline.
Each yield adds a child or label in source order. Use group to animate several targets as one child.
let timeline =
composedTimeline scheduler {
yield label "intro"
yield child title options titleProperties
yield group cards options cardProperties |> at (TimelinePosition.Expression "intro")
}
Open Ranvier.Anime.KeyframeDsl to author a KeyframeSequence with keyframes { ... }.
Yield KeyframeRow.values for sparse rows or KeyframeOffset.at for normalized positions.
Each sequence uses one kind of key and works with the existing numeric and typed CSS playback APIs.
An omitted property in a sparse row holds its previous endpoint. An offset key's ease applies to
the following segment for each property it contains. Use timeline.Play() after constructing a
composed timeline that should start immediately.
Parity
Behaviour is checked against anime.js v4.5.0 (commit 2c9cf8e) with reference traces generated from the upstream
source. Native interpolation also accepts named and modern CSS colours. Some pending-variable CSS shorthand
snapshots and the Three.js adapters remain unsupported. The package includes upstream notices in
THIRD-PARTY-NOTICES.md.
| Product | Versions Compatible and additional computed target framework versions. |
|---|---|
| .NET | net10.0 is compatible. net10.0-android was computed. net10.0-browser was computed. net10.0-ios was computed. net10.0-maccatalyst was computed. net10.0-macos was computed. net10.0-tvos was computed. net10.0-windows was computed. |
-
net10.0
- FSharp.Core (>= 10.0.100)
- Ranvier (>= 0.2.1)
- Ranvier.Css (>= 0.3.0)
- Ranvier.Css.Dom (>= 0.2.0)
- Ranvier.Dom (>= 0.1.0)
NuGet packages (2)
Showing the top 2 NuGet packages that depend on Ranvier.Anime:
| Package | Downloads |
|---|---|
|
Ranvier.View.Anime
Motion parts for Ranvier.View templates over the native Ranvier.Anime, for .NET hosts: lifecycle, enter and exit, FLIP and signal-driven animation, omitted by the server renderer. Fable projects use Fable.Ranvier.View.Anime. |
|
|
Ranvier.D5
Functional visualization foundations for F#: data, scales, geometry, layouts and reactive scenes using Ranvier signals and Anime. |
GitHub repositories
This package is not used by any popular GitHub repositories.
| Version | Downloads | Last Updated |
|---|---|---|
| 0.3.0 | 196 | 11/23/2026 |
| 0.2.0 | 86 | 11/18/2026 |
| 0.1.0 | 1,637 | 11/14/2026 |
| 0.1.0-rc.2 | 615 | 11/12/2026 |
| 0.1.0-rc.1 | 1,178 | 11/11/2026 |
Pre-1.0 release. The API may change before 1.0.