Skip to content

Matrix API

Matrix

Extends Effect.

Factory Function

typescript
createMatrix(config?: MatrixConfig)

Methods

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


MatrixConfig

typescript
interface MatrixConfig {
    columns?: number;
    speed?: number;
    color?: string;
    fontSize?: number;
    trailLength?: number;
    scale?: number;
}
PropertyTypeDefaultDescription
columnsnumber40Maximum number of active falling columns. Automatically halved on small screens.
speednumber1Fall speed multiplier. Higher values make characters fall faster.
colorstring'#00ff41'Hex color string for the trailing characters. The head character is always white.
fontSizenumber14Character size in pixels. Also determines column spacing. Scaled by scale.
trailLengthnumber20Base number of characters per column trail. Actual length varies randomly.
scalenumber1Scales font size proportionally.