solid-icons
Version:
Modern solution for use icons on SolidJS
12 lines (11 loc) • 554 B
JSX
export const CustomIcon = (props) => {
return IconTemplate(props.src, props);
};
export function IconTemplate(iconSrc, props) {
return (<svg {...iconSrc.a} {...props} color={props.color || "currentColor"} height={props.size || "1em"} width={props.size || "1em"} xmlns="http://www.w3.org/2000/svg" style={{
...(typeof props.style === "object" ? props.style : {}),
overflow: "visible",
}} innerHTML={props.title ? `${iconSrc.c}<title>${props.title}</title>` : iconSrc.c}
// @ts-ignore
src={undefined}/>);
}