retro-react
Version:
A React component library for building retro-style websites
46 lines (45 loc) • 1.45 kB
TypeScript
/// <reference types="react" />
import { ThemeUICSSObject } from 'theme-ui';
import { ColorGradients } from "../../utils/getColorGradients";
interface MouseTrailProps extends React.HTMLAttributes<HTMLDivElement> {
/**
* The size of each particle
*
* @default 5
*/
particleSize?: number;
/**
* The color of each particle
*
* @default 'rainbow'
*/
particleColor?: ColorGradients;
/**
* The offset of the particles from the mouse cursor.
* For example, if you want the particles to be at the bottom of the standard cursor, set offsetY to 15 and offsetX to 5.
*
* @default { x: 0, y: 0 }
*/
offset?: {
x: number;
y: number;
};
sx?: ThemeUICSSObject;
}
interface MouseTrailRef {
/**
* @internal The array of particles
*
* @default []
*/
particles: Array<HTMLDivElement>;
}
/**
* A component that renders a trail of particles that follow the mouse cursor around the screen when the mouse is moved.
* Will render only inside of a container where the component is placed. For entire screen coverage, place inside of a root container.
*
* `IMPORTANT:` Make sure to set the parent container to `position: relative`.
*
*/
export declare const MouseTrail: import("react").ForwardRefExoticComponent<MouseTrailProps & import("react").RefAttributes<MouseTrailRef>>;
export {};