tailwindlabs / heroicons

A set of free MIT-licensed high-quality SVG icons for UI development.
https://heroicons.com
MIT License
21.22k stars 1.27k forks source link

Suggestion: Add union type for typescript #502

Closed danieljarrett74 closed 2 years ago

danieljarrett74 commented 2 years ago

I wanted to make the suggestion of adding a union type for typescript that includes all icons. This way we can define fields for our component properties that restrict to that union type. Would that work?

export interface IButtonProps extends React.ButtonHTMLAttributes { icon: HeroIcon | undefined;

}