Skip to main content

Shadow Animations

Use shadowAnimation to animate shadow distance and create movement effects like hovering.

Type signature

type ShadowAnimation = {
from: number | string;
to: number | string;
spacingX: number;
spacingY: number;
delay?: number;
duration?: number;
options?: string;
};

Supported components

Example

import { IsometricPlane } from "isometric-react/isometric-plane";

export function AnimatedCubeShadow() {
return (
<IsometricPlane
size={{ width: 5, height: 5 }}
color: "cyan"
shadowAnimation={{
from: 1,
to: 4,
spacingX: 1,
spacingY: 1,
duration: 1.5,
options: "alternate infinite",
}}
/>
);
}

Rendered example

Fields

FieldTypeDescription
fromnumber | stringStarting shadow distance.
tonumber | stringEnding shadow distance.
spacingXnumberHorizontal shadow direction multiplier.
spacingYnumberVertical shadow direction multiplier.
delaynumberDelay before animation starts (seconds).
durationnumberAnimation duration (seconds).
optionsstringAdditional CSS animation options, for example "alternate infinite".