Gradient Icons
() => {const gradient = `url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg'><linearGradient id='grad'><stop offset='0%' stop-color='%23ff00cc'/><stop offset='100%' stop-color='%23333399'/></linearGradient></svg>#grad") `;return (<HStackw="full"bg="#edf3f8"_dark={{bg: "#3e3e3e",}}p={50}alignItems="center"justifyContent="center"spacing={5}><Icon boxSize={16} fill="none" viewBox="0 0 24 24" stroke={gradient}><path d="M3 3h2l.4 2M7 13h10l4-8H5.4M7 13L5.4 5M7 13l-2.293 2.293c-.63.63-.184 1.707.707 1.707H17m0 0a2 2 0 100 4 2 2 0 000-4zm-8 2a2 2 0 11-4 0 2 2 0 014 0z"></path></Icon>{" "}<Icon boxSize={16} fill="none" viewBox="0 0 24 24" stroke={gradient}><pathfillRule="evenodd"d="M7 2a1 1 0 00-.707 1.707L7 4.414v3.758a1 1 0 01-.293.707l-4 4C.817 14.769 2.156 18 4.828 18h10.343c2.673 0 4.012-3.231 2.122-5.121l-4-4A1 1 0 0113 8.172V4.414l.707-.707A1 1 0 0013 2H7zm2 6.172V4h2v4.172a3 3 0 00.879 2.12l1.027 1.028a4 4 0 00-2.171.102l-.47.156a4 4 0 01-2.53 0l-.563-.187a1.993 1.993 0 00-.114-.035l1.063-1.063A3 3 0 009 8.172z"clipRule="evenodd"/></Icon>{" "}<Icon boxSize={16} fill="none" viewBox="0 0 24 24" stroke={gradient}><pathfillRule="evenodd"d="M12.395 2.553a1 1 0 00-1.45-.385c-.345.23-.614.558-.822.88-.214.33-.403.713-.57 1.116-.334.804-.614 1.768-.84 2.734a31.365 31.365 0 00-.613 3.58 2.64 2.64 0 01-.945-1.067c-.328-.68-.398-1.534-.398-2.654A1 1 0 005.05 6.05 6.981 6.981 0 003 11a7 7 0 1011.95-4.95c-.592-.591-.98-.985-1.348-1.467-.363-.476-.724-1.063-1.207-2.03zM12.12 15.12A3 3 0 017 13s.879.5 2.5.5c0-1 .5-4 1.25-4.5.5 1 .786 1.293 1.371 1.879A2.99 2.99 0 0113 13a2.99 2.99 0 01-.879 2.121z"clipRule="evenodd"/></Icon></HStack>);};
The linearGradient id
is appended after the svg element in the data url.
() => {const [red500, brand600] = useToken("colors", ["red.500", "brand.600"]);const gradient = (<chakra.svg w={0} h={0} pos="absolute" aria-hidden="true" focusable="false"><linearGradient id="gradient" x2="1" y2="1"><stop offset="0%" stopColor="#447799" /><stop offset="50%" stopColor={red500} /><stop offset="full" stopColor={brand600} /></linearGradient></chakra.svg>);return (<HStackw="full"bg="#edf3f8"_dark={{bg: "#3e3e3e",}}p={50}alignItems="center"justifyContent="center"spacing={5}>{gradient}<IconboxSize={16}fill="none"viewBox="0 0 24 24"stroke="url(#gradient) #447799;"><pathfillRule="evenodd"d="M14.243 5.757a6 6 0 10-.986 9.284 1 1 0 111.087 1.678A8 8 0 1118 10a3 3 0 01-4.8 2.401A4 4 0 1114 10a1 1 0 102 0c0-1.537-.586-3.07-1.757-4.243zM12 10a2 2 0 10-4 0 2 2 0 004 0z"clipRule="evenodd"/>{" "}</Icon><IconboxSize={16}fill="none"viewBox="0 0 24 24"stroke="url(#gradient) #447799;"><pathfillRule="evenodd"d="M3.172 5.172a4 4 0 015.656 0L10 6.343l1.172-1.171a4 4 0 115.656 5.656L10 17.657l-6.828-6.829a4 4 0 010-5.656z"clipRule="evenodd"/></Icon><IconboxSize={16}fill="none"viewBox="0 0 24 24"stroke="url(#gradient) #447799;"><pathfillRule="evenodd"d="M6.672 1.911a1 1 0 10-1.932.518l.259.966a1 1 0 001.932-.518l-.26-.966zM2.429 4.74a1 1 0 10-.517 1.932l.966.259a1 1 0 00.517-1.932l-.966-.26zm8.814-.569a1 1 0 00-1.415-1.414l-.707.707a1 1 0 101.415 1.415l.707-.708zm-7.071 7.072l.707-.707A1 1 0 003.465 9.12l-.708.707a1 1 0 001.415 1.415zm3.2-5.171a1 1 0 00-1.3 1.3l4 10a1 1 0 001.823.075l1.38-2.759 3.018 3.02a1 1 0 001.414-1.415l-3.019-3.02 2.76-1.379a1 1 0 00-.076-1.822l-10-4z"clipRule="evenodd"/></Icon></HStack>);};
Proudly developed in by Anuoluwapo Abraham