1.1.0 • Published 5 years ago
typed-md-icons v1.1.0
Typed MD Icons
A list of all Google's material design icons' names.
This package provides several entities related to Google's material design icons (see material-design-icons package):
IconName: union of all icons names (string literal types);IconNameMap: type of object, whose properties have both key and value equal to icon nameIconNameList: type of array, that contains all icon namesmap: implementation ofIconNameMap;list: implementation ofIconNameList;
Use it in .ts or .tsx files like this:
// React component definition
import React from "react";
import { IconName } from "typed-md-icons";
interface IconProps {
children: IconName;
}
export default function Icon({ children, className, ...props }: IconProps) {
return (
<i {...props} className={"material-icons " + className}>
{children}
</i>
);
}// React component usage
const accessibilityIcon = <Icon>accessibility_new<Icon/>;