Skip to content

Roots API

Roots

Extends Effect.

Factory Function

typescript
createRoots(config?: RootsConfig)

Methods

See Effect for the full method reference: mount(), start(), pause(), resume(), configure(), withFade(), and destroy().


RootsConfig

typescript
interface RootsConfig {
    count?: number;
    speed?: number;
    color?: string;
    branchProbability?: number;
    maxSegments?: number;
    scale?: number;
}
PropertyTypeDefaultDescription
countnumber5Number of independent root systems.
speednumber1Growth speed multiplier.
colorstring'#4a3728'CSS color string for the root lines. Slight variation applied per branch.
branchProbabilitynumber0.3Relative probability of a tip splitting into two branches.
maxSegmentsnumber200Maximum segments per root system before it fades and resets.
scalenumber1Scales root line widths and step sizes proportionally.