← Back

Backpack

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

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

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

.ai-backpack-icon .strap {
  transform-origin: center bottom;
}

.ai-backpack-icon:not(.no-hover):hover .strap {
  animation: ai-backpack-motion-1 700ms ease-in-out;
}

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

@keyframes ai-backpack-motion-1 {
  0%,
  100% {
    transform: translateY(0);
  }
  50% {
    transform: translateY(-1.25px);
  }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <rect className="body" x="1.75" y="3.5" width="11.5" height="10" rx="1.5" stroke="currentColor" strokeWidth="1"/>
        <path className="strap" d="M5.5 3.5V1.75C5.5 1.34 5.84 1 6.25 1H8.75C9.16 1 9.5 1.34 9.5 1.75V3.5" stroke="currentColor" strokeWidth="1" strokeLinecap="round" strokeLinejoin="round"/>
        <rect className="pocket" x="4" y="7.5" width="7" height="4" rx="0.5" stroke="currentColor" strokeWidth="1"/>
      </svg>
    </>
  );
}