Skip to Content

React Integration

Welcome to the React integration section of Lineicons documentation. Here we’ll guide you on how to integrate your React projects and start using Lineicons.

You can effortlessly add a huge range of scalable and customizable icons to your React applications. In this guide, we will walk you through installation, implementation, and customization to ensure the icons go perfectly with your project’s design and functionality.

How to Integrate Lineicons with React Projects

Lineicons provides ready-to-use React components for Lineicons via NPM package for both Free and Pro Icons. Making it easy to add clean, scalable SVG icons to your React or Next.js projects. You can customize size, color, and style with simple props.

Step-1: Install the React wrapper and the free icons package:

npm install @lineiconshq/react-lineicons @lineiconshq/free-icons

Step-2: After installing the package import icon and use anywhere -

import React from "react"; import { Lineicons } from "@lineiconshq/react-lineicons"; import { Home2Outlined, CloudBolt1Bulk, CloudBolt1Outlined, CloudBolt1Duotone, CloudBolt1Solid, } from "@lineiconshq/free-icons"; function App() { return ( <div> <Lineicons icon={Home2Outlined} size={24} color="blue" strokeWidth={1.5} /> <Lineicons icon={CloudBolt1Bulk} size={40} color="orange" /> <Lineicons icon={CloudBolt1Outlined} size={50} color="blue" /> <Lineicons icon={CloudBolt1Duotone} size={30} color="green" /> <Lineicons icon={CloudBolt1Solid} size={24} /> </div> ); } export default App;

Using Pro Icons

Pro gives you access to all 31,204 icons and works the same way as the free package.

Pro packages are not on the public npm registry, so npm install @lineiconshq-pro/... on its own will fail. Log in to your Lineicons account and download the package files from the Downloads  page, then install them from a local file.

Download the Pro packages

Log in to your Lineicons account and open Downloads  from the account menu. Download the .tgz file for each style you need: Stroke, Outlined, Solid, Duotone, or Bulk.

Move them into your project

Run this from your project root (change ~/Downloads if you saved the files elsewhere):

mkdir -p vendor/lineicons && mv ~/Downloads/lineiconshq-pro-core-*.tgz vendor/lineicons/

Install the Pro packages

This installs every .tgz file in vendor/lineicons:

npm install ./vendor/lineicons/*.tgz

On Windows, *.tgz is not expanded. List each file path instead, as shown in the Pro Packages guide.

Install the wrapper

Pro icons render through @lineiconshq/react-lineicons, the same package you use for free icons. Skip this step if you already installed it.

npm install @lineiconshq/react-lineicons

Use Pro icons

Import icons from the Pro package for the style you want. Pro icon names have no style suffix, so the outlined AlarmError comes from @lineiconshq-pro/core-outlined.

import React from "react"; import { Lineicons } from "@lineiconshq/react-lineicons"; import { AlarmError } from "@lineiconshq-pro/core-outlined"; function App() { return ( <div> <Lineicons icon={AlarmError} size={24} color="blue" strokeWidth={1.5} /> </div> ); } export default App;

To get an icon’s import name, open it on lineicons.com/icons , click Copy Icon Name, and convert it to PascalCase (alarm-error → AlarmError).

Tip: You can install free and Pro packages together. If two imports share a name, rename one on import, for example import { AlarmError as AlarmErrorSolid } from "@lineiconshq-pro/core-solid";.

Commit vendor/lineicons so CI and hosting builds can install it, but only in private repositories. Never publish the .tgz files to npm or push them to a public repo.

For deploying, updating, and troubleshooting, see Pro Packages.

API Reference

<Lineicons />

interface LineiconsProps extends React.SVGProps<SVGSVGElement> { icon: React.ComponentType<React.SVGProps<SVGSVGElement>>; size?: number | string; color?: string; strokeWidth?: number; className?: string; }
PropTypeDefaultDescription
iconReact.ComponentType<SVGProps<SVGSVGElement>>— (required)The icon component to render.
sizenumber | string24Icon size (pixels or CSS units).
colorstringcurrentColorIcon color.
strokeWidthnumber1.5Stroke width for outlined icons.
classNamestring—Optional CSS class for custom styling.

All other valid SVG props are supported and passed through.

Last updated on