UNPKG

react-atmospheres

Version:

A lightweight wrapper to add seasonal, themed visual effects in your React app.

47 lines (42 loc) 1.58 kB
import * as react_jsx_runtime from 'react/jsx-runtime'; import React, { ReactNode } from 'react'; type AtmospheresType = 'snow' | 'hearts' | 'spooky' | 'none'; interface Props { /** Children to render inside the atmospheres */ children: ReactNode; /** Type of animation to use */ animation?: AtmospheresType; /** Disable the animation */ disabled?: boolean; /** Amount of animated objects, can not be higher then 100 */ particleAmount?: number; /** Color of the animated objects */ color?: string; /** Color of the outline of the animated objects */ outlineColor?: string; /** Speed factor for the animation, can not be higher then 2 */ speedFactor?: number; } declare const Atmospheres: ({ children, animation, disabled, particleAmount, color, outlineColor, speedFactor, }: Props) => react_jsx_runtime.JSX.Element; interface SnowProps { containerRef: React.RefObject<HTMLElement>; color?: string; outlineColor?: string; maxFlakes?: number; speedFactor?: number; } declare const SnowAnimation: React.FC<SnowProps>; interface HeartProps { /** Reference to the container element */ containerRef: React.RefObject<HTMLElement>; /** Color of the heart fill */ color?: string; /** outline color of the heart */ outlineColor?: string; /** Maximum number of hearts to display */ maxHearts?: number; /** Speed factor for the hearts */ speedFactor?: number; } declare const HeartAnimation: React.FC<HeartProps>; export { Atmospheres, HeartAnimation, SnowAnimation };