1.1.0 • Published 5 years ago

typed-md-icons v1.1.0

Weekly downloads
-
License
MIT
Repository
gitlab
Last release
5 years ago

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 name
  • IconNameList: type of array, that contains all icon names
  • map: implementation of IconNameMap;
  • list: implementation of IconNameList;

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/>;
1.1.0

5 years ago

1.0.2

7 years ago

1.0.1

7 years ago

1.0.0

7 years ago