← Back

Filter

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

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

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

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

.ai-filter-icon .bar { transform-origin: center; }

.ai-filter-icon:not(.no-hover):hover .bar {
  animation: ai-filter-narrow 700ms ease-in-out;
}

.ai-filter-icon:not(.no-hover):hover .bar-1 { animation-delay: 0ms; }
.ai-filter-icon:not(.no-hover):hover .bar-2 { animation-delay: 100ms; }
.ai-filter-icon:not(.no-hover):hover .bar-3 { animation-delay: 200ms; }

@keyframes ai-filter-narrow {
  0%, 100% { transform: scaleX(1); }
  50% { transform: scaleX(0.65); }
}
`}</style>
      <svg
        xmlns="http://www.w3.org/2000/svg"
        className={classes}
        viewBox="0 0 15 15"
        fill="none"
      >
        <path className="bar bar-3" d="M9.60059 10.0098C9.82855 10.0563 10 10.2583 10 10.5C10 10.7417 9.82855 10.9437 9.60059 10.9902L9.5 11H5.5C5.22386 11 5 10.7761 5 10.5C5 10.2239 5.22386 10 5.5 10H9.5L9.60059 10.0098Z" fill="currentColor"/>
        <path className="bar bar-2" d="M11.6006 7.00977C11.8286 7.05629 12 7.25829 12 7.5C12 7.74171 11.8286 7.94371 11.6006 7.99023L11.5 8H3.5C3.22386 8 3 7.77614 3 7.5C3 7.22386 3.22386 7 3.5 7H11.5L11.6006 7.00977Z" fill="currentColor"/>
        <path className="bar bar-1" d="M13.5 4C13.7761 4 14 4.22386 14 4.5C14 4.77614 13.7761 5 13.5 5H1.5C1.22386 5 1 4.77614 1 4.5C1 4.22386 1.22386 4 1.5 4H13.5Z" fill="currentColor"/>
      </svg>
    </>
  );
}