npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2024 – Pkg Stats / Ryan Hefner

@solar-icons/react-perf

v1.0.0

Published

Solar Icons for React with performance in mind

Downloads

68

Readme

@solar-icons/react-perf

The @solar-icons/react-perf package provides a highly optimized, performance-focused library of React components for the Solar icon set. This package is tailored for developers who prioritize reduced bundle sizes and efficient rendering by focusing on single-style imports and simplified SVG structures.

Installation

Install the package using npm or yarn:

npm install @solar-icons/react-perf

or

yarn add @solar-icons/react-perf

Usage

To use an icon in your React application, import the specific icon directly for optimal performance:

import { ArrowUpBold, ArrowUpLinear } from '@solar-icons/react-perf'

function App() {
    return (
        <div>
            <ArrowUpBold size={24} color="#000" />
            <ArrowUpLinear size={32} color="blue" />
        </div>
    )
}

Importing by Style

For more modular imports, you can import icons by style:

import { ArrowUp } from '@solar-icons/react-perf/linear'
import { ArrowDown } from '@solar-icons/react-perf/bold'

function App() {
    return (
        <div>
            <ArrowUp size={24} />
            <ArrowDown size={32} />
        </div>
    )
}

Key Features

  • Performance-Oriented: Each icon is packaged individually, ensuring that only the required assets are included in the final bundle.
  • Single-Style Icons: Icons are separated by style (e.g., Bold, Linear), enabling more precise imports.
  • Lightweight SVGs: Each icon is optimized for minimal SVG size to reduce load times.

Properties

Each icon component supports the following properties:

  • size: Defines the size of the icon (e.g., 24, "1.5em").
  • color: Sets the color of the icon (e.g., "#000", "currentColor").
  • mirrored: Flips the icon horizontally when set to true.

Advanced Usage

Custom Styling

Customize icons using standard React properties or additional CSS classes:

import { ArrowUpBold } from '@solar-icons/react-perf'

function CustomIcon() {
    return <ArrowUpBold size="48" className="custom-class" />
}

Performance Benefits

Unlike the versatile @solar-icons/react package, @solar-icons/react-perf focuses solely on direct imports for enhanced performance and reduced overhead. This package avoids using a provider or dual SSR/CSR support to ensure lightweight integration.

Contributing

Contributions to further optimize and expand the @solar-icons/react-perf package are welcome. If you wish to contribute, please follow our contribution guidelines.

License

The @solar-icons/react-perf code and library are licensed under the MIT License. The Solar icon pack itself is licensed under CC BY 4.0 by 480 Design, which requires attribution for any use. For more information and to view the original icon set, visit 480 Design's Figma page.

Acknowledgements

Special thanks to 480 Design for creating the original Solar icon pack. Additional appreciation goes to Phosphor Icons and Lucide Icons for their inspiration in shaping the design and approach of the Solar icon packages.


For more details on other packages and usage examples, refer to the project's main documentation.