Skip to content
Cuelark UI

Hover the icon or press Play. Suggested motion: pop. Pick another to preview it and update the animated code:

css.gg · CgMagnet

Magnet icon

A free magnet icon from css.gg, ready for React. Use it static or animated: both versions are below, copy-paste or one shadcn command away. Sized in em and colored by currentColor.

License
MIT license
Project
github.com
Install with shadcn
npx shadcn@latest add https://ui.cuelark.com/r/icons/css-gg/magnet.json
components/icons/css-gg-magnet.tsx
import * as React from "react";

/**
 * Magnet from css.gg (https://github.com/astrit/css.gg), MIT.
 * Via Cuelark UI: ui.cuelark.com/icons/css-gg/magnet. Sized in em, colored by currentColor.
 */
export function CgMagnetIcon(props: React.SVGProps<SVGSVGElement>) {
  return (
    <svg
      aria-hidden="true"
      fill="none"
      viewBox="0 0 24 24"
      stroke="currentColor"
      fill="currentColor"
      strokeWidth="0"
      width="1em"
      height="1em"
      xmlns="http://www.w3.org/2000/svg"
      {...props}
    >
      <path d="M8 2.5H4V5.5H8V2.5Z" fill="currentColor" fillOpacity="0.5" />
      <path d="M20 2.5H16V5.5H20V2.5Z" fill="currentColor" fillOpacity="0.5" />
      <path
        d="M8 7.5H4V13.5C4 17.9183 7.58172 21.5 12 21.5C16.4183 21.5 20 17.9183 20 13.5V7.5H16V13.5C16 15.7091 14.2091 17.5 12 17.5C9.79086 17.5 8 15.7091 8 13.5V7.5Z"
        fill="currentColor"
      />
    </svg>
  );
}
With react-icons
import { CgMagnet } from "react-icons/cg";

export function Example() {
  return <CgMagnet className="size-5" />;
}
magnet.svg
<svg
  fill="none"
  viewBox="0 0 24 24"
  stroke="currentColor"
  fill="currentColor"
  stroke-width="0"
  width="1em"
  height="1em"
  xmlns="http://www.w3.org/2000/svg"
>
  <path d="M8 2.5H4V5.5H8V2.5Z" fill="currentColor" fill-opacity="0.5" />
  <path d="M20 2.5H16V5.5H20V2.5Z" fill="currentColor" fill-opacity="0.5" />
  <path
    d="M8 7.5H4V13.5C4 17.9183 7.58172 21.5 12 21.5C16.4183 21.5 20 17.9183 20 13.5V7.5H16V13.5C16 15.7091 14.2091 17.5 12 17.5C9.79086 17.5 8 15.7091 8 13.5V7.5Z"
    fill="currentColor"
  />
</svg>
Attribution
"Magnet" icon from css.gg (https://github.com/astrit/css.gg), licensed under MIT license.

Magnet icon in other sets