Sign Up for Free

RunKit +

Try any Node.js package right in your browser

This is a playground to test code. It runs a full Node.js environment and already has all of npm’s 400,000 packages pre-installed, including @ant-design/icons-react with all npm packages installed. Try it out:

require("@ant-design/icons/package.json"); // @ant-design/icons is a peer dependency. require("react/package.json"); // react is a peer dependency. var iconsReact = require("@ant-design/icons-react")

This service is provided by RunKit and is not affiliated with npm, Inc or the package authors.

@ant-design/icons-react v2.0.1

Ant Design Icons for React

NPM version NPM downloads

Install

yarn add @ant-design/icons
yarn add @ant-design/icons-react

Basic Usage

First, you should add the icons that you need into the library.

import { AntDesignOutline, DashboardOutline, TwitterOutline } from '@ant-design/icons';
import AntdIcon from '@ant-design/icons-react';
AntdIcon.add(AntDesignOutline, DashboardOutline);

After that, you can use antd icons in your React components as simply as this:

<AntdIcon type="ant-design-o" />
<AntdIcon type="dashboard-o" />
<AntdIcon type={TwitterOutline} />

Component Interface

interface AntdIconProps {
  type: string | IconDefinition;
  className?: string;
  onClick?: React.MouseEventHandler<SVGSVGElement>;
  style?: React.CSSProperties;
}
RunKit is a free, in-browser JavaScript dev environment for prototyping Node.js code, with every npm package installed. Sign up to share your code.
Sign Up for Free