Cloud Lightning Icon

PreviousNext

Cloud lightning icon component.

Docs
animate-uiui

Preview

Loading preview…
registry/icons/cloud-lightning/index.tsx
'use client';

import * as React from 'react';
import { motion, type Variants } from 'motion/react';

import {
  getVariants,
  useAnimateIconContext,
  IconWrapper,
  type IconProps,
} from '@/components/animate-ui/icons/icon';

type CloudLightningProps = IconProps<keyof typeof animations>;

const animations = {
  default: {
    path1: {},
    path2: {
      initial: {
        opacity: 1,
        scale: 1,
      },
      animate: {
        opacity: [1, 0.5, 1, 0.5, 1],
        scale: [1, 0.9, 1, 0.9, 1],
        transition: {
          duration: 1.8,
          ease: 'easeInOut',
        },
      },
    },
  } satisfies Record<string, Variants>,
} as const;

function IconComponent({ size, ...props }: CloudLightningProps) {
  const { controls } = useAnimateIconContext();
  const variants = getVariants(animations);

  return (
    <motion.svg
      xmlns="http://www.w3.org/2000/svg"
      width={size}
      height={size}
      viewBox="0 0 24 24"
      fill="none"
      stroke="currentColor"
      strokeWidth={2}
      strokeLinecap="round"
      strokeLinejoin="round"
      initial="initial"
      animate={controls}
      {...props}
    >
      <motion.path
        d="M6 16.326A7 7 0 1 1 15.71 8h1.79a4.5 4.5 0 0 1 .5 8.973"
        variants={variants.path1}
        initial="initial"
        animate={controls}
      />
      <motion.path
        d="m13 12-3 5h4l-3 5"
        variants={variants.path2}
        initial="initial"
        animate={controls}
      />
    </motion.svg>
  );
}

function CloudLightning(props: CloudLightningProps) {
  return <IconWrapper icon={IconComponent} {...props} />;
}

export {
  animations,
  CloudLightning,
  CloudLightning as CloudLightningIcon,
  type CloudLightningProps,
  type CloudLightningProps as CloudLightningIconProps,
};

Installation

npx shadcn@latest add @animate-ui/icons-cloud-lightning

Usage

import { IconsCloudLightning } from "@/components/ui/icons-cloud-lightning"
<IconsCloudLightning />