← Back

Sun

Install

npm install @svg-animated-icons/react

CLI

Copy an icon component straight into your project — shadcn-style. Replace {icon} with an icon name like arrow-left.

terminal
npx @svg-animated-icons/cli add {icon} --react
FlagDescription
--dest <dir>Destination directory (default: components/animated-icons)

Or copy the component with the CLI

CLI
npx @svg-animated-icons/cli add sun --react

Code

React
// Generated by @svg-animated-icons/cli
// You own this file — edit it freely.

import React from "react";

type Props = {
  disableHover?: boolean;
  className?: string;
};

export function SunIcon({ disableHover, className }: Props) {
  const classes = [
    "ai-sun-icon",
    disableHover ? "no-hover" : "",
    className ?? "",
  ]
    .filter(Boolean)
    .join(" ");

  return (
    <>
      <style>{`
.ai-sun-icon {
  width: 1em;
  height: 1em;
  display: inline-block;
  cursor: pointer;
  overflow: visible;
}

.ai-sun-icon * {
  transform-box: fill-box;
}

.ai-sun-icon.no-hover * {
  transform: none;
  opacity: 1;
  animation: none;
}

.ai-sun-icon [class^="ray-"] {
  transform-box: view-box;
  transform-origin: 7.5px 7.5px;
}

.ai-sun-icon:not(.no-hover):hover [class^="ray-"] {
  animation: ai-sun-burst 700ms ease-in-out;
}

.ai-sun-icon:not(.no-hover):hover .ray-top { animation-delay: 0ms; }
.ai-sun-icon:not(.no-hover):hover .ray-tr { animation-delay: 40ms; }
.ai-sun-icon:not(.no-hover):hover .ray-right { animation-delay: 80ms; }
.ai-sun-icon:not(.no-hover):hover .ray-br { animation-delay: 120ms; }
.ai-sun-icon:not(.no-hover):hover .ray-bottom { animation-delay: 160ms; }
.ai-sun-icon:not(.no-hover):hover .ray-bl { animation-delay: 200ms; }
.ai-sun-icon:not(.no-hover):hover .ray-left { animation-delay: 240ms; }
.ai-sun-icon:not(.no-hover):hover .ray-tl { animation-delay: 280ms; }

@keyframes ai-sun-burst {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.25); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="orb" fillRule="evenodd" d="M7.5 4.5C9.15685 4.5 10.5 5.84315 10.5 7.5C10.5 9.15685 9.15685 10.5 7.5 10.5C5.84315 10.5 4.5 9.15685 4.5 7.5C4.5 5.84315 5.84315 4.5 7.5 4.5ZM7.5 5.5C6.39543 5.5 5.5 6.39543 5.5 7.5C5.5 8.60457 6.39543 9.5 7.5 9.5C8.60457 9.5 9.5 8.60457 9.5 7.5C9.5 6.39543 8.60457 5.5 7.5 5.5Z" fill="currentColor"/>
        <path className="ray-bottom" d="M7.5 12C7.77614 12 8 12.2239 8 12.5V14.5C8 14.7761 7.77614 15 7.5 15C7.22386 15 7 14.7761 7 14.5V12.5C7 12.2239 7.22386 12 7.5 12Z" fill="currentColor"/>
        <path className="ray-bl" d="M3.61133 10.6816C3.80662 10.4868 4.12322 10.4865 4.31836 10.6816C4.5135 10.8768 4.51324 11.1934 4.31836 11.3887L2.90332 12.8037C2.70802 12.9985 2.3914 12.9988 2.19629 12.8037C2.00118 12.6086 2.00147 12.292 2.19629 12.0967L3.61133 10.6816Z" fill="currentColor"/>
        <path className="ray-br" d="M10.6816 10.6816C10.8768 10.4865 11.1934 10.4868 11.3887 10.6816L12.8037 12.0967C12.9985 12.292 12.9988 12.6086 12.8037 12.8037C12.6086 12.9988 12.292 12.9985 12.0967 12.8037L10.6816 11.3887C10.4868 11.1934 10.4865 10.8768 10.6816 10.6816Z" fill="currentColor"/>
        <path className="ray-left" d="M2.5 7C2.77614 7 3 7.22386 3 7.5C3 7.77614 2.77614 8 2.5 8H0.5C0.223858 8 0 7.77614 0 7.5C0 7.22386 0.223858 7 0.5 7H2.5Z" fill="currentColor"/>
        <path className="ray-right" d="M14.5 7C14.7761 7 15 7.22386 15 7.5C15 7.77614 14.7761 8 14.5 8H12.5C12.2239 8 12 7.77614 12 7.5C12 7.22386 12.2239 7 12.5 7H14.5Z" fill="currentColor"/>
        <path className="ray-tl" d="M2.19629 2.19629C2.3914 2.00118 2.70802 2.00147 2.90332 2.19629L4.31836 3.61133C4.51324 3.80662 4.5135 4.12322 4.31836 4.31836C4.12322 4.5135 3.80662 4.51324 3.61133 4.31836L2.19629 2.90332C2.00147 2.70802 2.00118 2.3914 2.19629 2.19629Z" fill="currentColor"/>
        <path className="ray-tr" d="M12.0967 2.19629C12.292 2.00147 12.6086 2.00118 12.8037 2.19629C12.9988 2.3914 12.9985 2.70802 12.8037 2.90332L11.3887 4.31836C11.1934 4.51324 10.8768 4.5135 10.6816 4.31836C10.4865 4.12322 10.4868 3.80662 10.6816 3.61133L12.0967 2.19629Z" fill="currentColor"/>
        <path className="ray-top" d="M7.5 0C7.77614 0 8 0.223858 8 0.5V2.5C8 2.77614 7.77614 3 7.5 3C7.22386 3 7 2.77614 7 2.5V0.5C7 0.223858 7.22386 0 7.5 0Z" fill="currentColor"/>
      </svg>
    </>
  );
}