Skip to main content
Partas

Spring

Also provides an extension for float setters.

open Partas.Solid.Primitives.Spring.SetterExtensions
[<Extension>]
static member inline Invoke(
setter: Setter<float>,
newValue: float,
options: StringSetterOptions
): ???
warning

The above binding seems janky and needs to be reviewed

createSpring

let createSpring(
inialValue: 'T when 'T :> (float | float seq | Accessor<float>),
?stiffness: float,
?damping: float
): Signal<'T>
ParamDesc
initialValueThe initial value of the signal.
stiffnessOptions to configure the physics of the spring.
dampingOptions to configure the physics of the spring.

Creates a Signal<float> that uses spring physics when interpolating from one value to another.

This means when the value changes, instead of transitioning at a steady rate, it 'bounces' like a spring would, depending on the physics parameters provided. This adds a level of realism to the transitions and can enhance the user experience.

Works best for basic data types that can be interpolated, such as number types, Date, and Arrays.

createDerivedSpring

let createDerivedSpring(
target: Accessor<'T when 'T :> (float | float seq)>,
?stiffness: float,
?damping: float
): Accessor<'T>

Creates a spring that interpolates based on changes to the passed signal.

Works similar to @solid-primitives/tween.

Last updated: 7/11/25, 1:35 AM

PartasBuilt using the Partas.SolidStart SolidBase template
Community
githubdiscord