Skip to main content
React Icons includes full TypeScript support with comprehensive type definitions for all icons, props, and configuration options.

Built-in TypeScript Support

React Icons v3+ includes native TypeScript support - no additional @types package needed:
If you previously installed @types/react-icons, you can safely remove it:

Core Types

IconType

The IconType is the type of all icon components:
Usage:

IconBaseProps

All icon components accept IconBaseProps:
Property Details: Usage:

IconContext

The context configuration interface:
Usage:

Type-Safe Icon Components

Basic Icon Usage

Icon Component Props

Dynamic Icon Selection

Advanced TypeScript Patterns

Generic Icon Wrapper

Icon Button Component

Constrained Icon Sets

Icon Library Type

Type Inference

TypeScript automatically infers types from React Icons:

Utility Types

Extract Icon Props

Icon Union Type

Common Type Patterns

Optional Icon Prop

Icon Array

Icon with Config

React.FC with Icons

Type Guards

Strict Mode

React Icons works with strict TypeScript configurations:

Type Exports

React Icons exports all necessary types:
The IconTree type is used internally for icon generation and typically not needed in application code.

Next Steps

Icon Imports

Learn about importing icons with full type safety

Icon Context

Configure typed icon contexts