← Back

Mobile

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 mobile --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 MobileIcon({ disableHover, className }: Props) {
  const classes = [
    "ai-mobile-icon",
    disableHover ? "no-hover" : "",
    className ?? "",
  ]
    .filter(Boolean)
    .join(" ");

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

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

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

.ai-mobile-icon .phone {
  transform-box: view-box;
  transform-origin: 7.5px 7.5px;
}

.ai-mobile-icon:not(.no-hover):hover .phone {
  animation: ai-mobile-buzz 700ms ease-in-out;
}

@keyframes ai-mobile-buzz {
  0%, 100% { transform: rotate(0); }
  15% { transform: rotate(-4deg); }
  30% { transform: rotate(4deg); }
  45% { transform: rotate(-3deg); }
  60% { transform: rotate(3deg); }
  80% { transform: rotate(-1deg); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="phone" d="M10.5 1C11.3284 1 12 1.67157 12 2.5V12.5C12 13.3284 11.3284 14 10.5 14H4.5C3.67157 14 3 13.3284 3 12.5V2.5C3 1.67157 3.67157 1 4.5 1H10.5ZM4.5 2C4.22386 2 4 2.22386 4 2.5V12.5C4 12.7761 4.22386 13 4.5 13H10.5C10.7761 13 11 12.7761 11 12.5V2.5C11 2.22386 10.7761 2 10.5 2H4.5ZM9.07031 11.6572C9.2299 11.6898 9.34961 11.8308 9.34961 12C9.34961 12.1692 9.2299 12.3102 9.07031 12.3428L9 12.3496H6C5.8067 12.3496 5.65039 12.1933 5.65039 12C5.65039 11.8067 5.8067 11.6504 6 11.6504H9L9.07031 11.6572Z" fill="currentColor"/>
      </svg>
    </>
  );
}