React

@coolicons/react has one component per icon, with an entry for every style and corner radius.

Install

npm install @coolicons/react

Requires React 18 or later.

Use

Import icons by name. Only the icons you import end up in your bundle.

Toolbar.jsx
import { House, Folder } from "@coolicons/react";

export function Toolbar() {
  return (
    <nav>
      <House size={20} />
      <Folder strokeWidth={1.5} title="Projects" />
    </nav>
  );
}

Styles and corners

The package root is Line with Regular corners. Every other combination has its own entry, with the same component names in each.

React entries
Import fromGives you
@coolicons/reactLine, Regular corners
@coolicons/react/fillFill, Regular corners
@coolicons/react/bulk/roundBulk, Round corners
@coolicons/react/<style>/<radius>Any combination
Imports
import { House } from "@coolicons/react";
import { Folder } from "@coolicons/react/fill";
import { Bell } from "@coolicons/react/bulk/round";

Styles are line, duocolor, duotone, fill and bulk. Corners are sharp, regular and round.

Props

Icon props
PropDefaultWhat it does
size24Width and height. A number is pixels, a string can be any CSS length, like 1.25rem or 1em.
strokeWidth2Stroke width of Line, Duocolor and Duotone. Fill and Bulk have no strokes and ignore it.
titlenoneAdds a <title> and role="img". Without a title the icon gets aria-hidden="true".

All other props go to the svg element: className, style, aria-*, event handlers and a ref to the svg.

Props
<House
  size="1.25rem"
  strokeWidth={1.5}
  className="nav-icon"
  title="Home"
/>

Names

Components use the icon name in PascalCase: file-plus-corner becomes FilePlusCorner. Every component is also exported with an Icon suffix, like FilePlusCornerIcon. Both names always work.

Use the plain name unless JavaScript, the browser or a framework already uses it. Map is a JavaScript global, File a browser global and Link a component in Next.js and React Router. Importing an icon with such a name hides the original in that file, so value instanceof File quietly stops working. For these icons, use the suffix.

Icon suffix
import Link from "next/link";
import { LinkIcon } from "@coolicons/react";
Names with the Icon suffix
ComponentTaken in
ActivityIconReact
BluetoothIconBrowser
ClipboardIconBrowser, React Native
CodeIconAstro
ComponentIconReact, Preact, Angular
FileIconBrowser, Node, Deno, Bun, React Native
FontIconAstro
FunctionIconJavaScript
GamepadIconBrowser
HistoryIconBrowser
ImageIconBrowser, Next.js, React Native, Astro
InfinityIconJavaScript
KeyboardIconBrowser, React Native
LabelIconExpo Router
LinkIconNext.js, React Router, TanStack Router, Expo Router, Qwik, Inertia, Gatsby
LockIconBrowser, Deno
MapIconJavaScript
NavigationIconBrowser
OptionIconBrowser
PresentationIconBrowser
RouteIconReact Router, TanStack Router, Solid
RouterIconReact Router, TanStack Router, Solid, Angular
SettingsIconReact Native
ShareIconReact Native
TextIconBrowser, React Native, Vue
WindowIconBrowser, Deno

TypeScript

Types ship with the package. Every entry exports IconProps, IconComponent, IconVariant and IconRadius.

Types
import type { IconComponent } from "@coolicons/react";

type NavItem = { label: string; icon: IconComponent };

To render an icon from a string, use CooliconsIcon.