Skip to content

Tooni/iconscout-unicons-react

Repository files navigation

iconscout-unicons-react

Making Iconscout's Unicons SVG sets available again, as React components, since the official sources aren't maintained anymore. TypeScript and ref-forwarding are supported.

Based on these:

Use

Install with

npm install @tooni/iconscout-unicons-react

The library provides four entrypoints, corresponding to the styles of Unicons. The default is the 'line' style.

Import them like this:

// equivalent to `import {UilArrowCompressH} from "@tooni/iconscout-unicons-react/line"`
import {UilArrowCompressH} from "@tooni/iconscout-unicons-react"

import {UimAlignRightJustify} from "@tooni/iconscout-unicons-react/monochrome"
import {UisBriefcase} from "@tooni/iconscout-unicons-react/solid"
import {UitRocket} from "@tooni/iconscout-unicons-react/thinline"

A size and a color prop are exposed on the icons. Use them in React JSX or TSX like this:

<div>
    Some Iconscout Unicons: <br/>
    <span>
        <UimAlignRightJustify size={48} color="green" />
        <UilArrowCompressH size={48} color="blue" />
        <UisBriefcase size={48} color="red" />
        <UitRocket size={48} color="brown" />
    </span>
</div>

It could look like this:

Screenshot 2024-08-25 at 21 20 08