UNPKG

svelte-animate

Version:

A lightweight Svelte component that adds beautiful CSS animations to any element using Animate.css library. Features include click/hover triggers, customizable duration, reduced motion support, and accessibility features. Perfect for creating engaging use

32 lines (31 loc) 995 B
import 'animate.css'; import type { HTMLButtonAttributes } from 'svelte/elements'; import type { Snippet } from 'svelte'; import type { AnimationType } from './types.ts'; type TriggerType = 'hover' | 'click' | 'both' | undefined; type DurationType = '1s' | '2s' | '3s' | '800ms' | '500ms'; type DelayType = '0s' | '1s' | '2s' | '3s' | '4s' | '5s'; type RepeatType = '1' | '2' | '3' | 'infinite'; interface Props extends HTMLButtonAttributes { animation?: AnimationType; trigger?: TriggerType; duration?: DurationType; children: Snippet; hideAfter?: boolean; delay?: DelayType; repeat?: RepeatType; } /** * [Go to docs](https://svelte-animate.codewithshin.com/) * ## Props * @prop children * @prop animation = 'bounce' * @prop trigger * @prop duration = '1s' * @prop hideAfter = false * @prop delay * @prop repeat */ declare const AnimateV1: import("svelte").Component<Props, {}, "">; type AnimateV1 = ReturnType<typeof AnimateV1>; export default AnimateV1;