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

latest-react-3d-icons

v1.0.4

Published

3d, Animated, Drag-and-Drop icons for React

Downloads

16

Readme

react-3d-icons

A simple and easy-to-use library for adding 3d icons into any React project.

this is an updated version from the original package to work in new three.js versions updated by Mo-Adeeb-Alkahat

Example

Gif Demonstration

The library provides thousands of icons ready to go, and can be extended with any SVG you want.

Installation

ThreeJS and React Three Fiber are expected to already be installed in the project.

npm install three @react-three/fiber

npm install latest-react-3d-icons

How to use

Import the Icon element:

import { Icon } from "latest-react-3d-icons";

Import icon(s) you would like to use (full list below):

import { twitter, github } from "latest-react-3d-icons";

Add the Icon element and specify your icon as well as any other parameters.
If size is unspecified, the icon's canvas will fill the size of its parent.

<Icon file={twitter} color={"#1DA1F2"} scale={10} style={{ height: "100px", width: "100px" }} />

<div style={{ height: "150px", width: "150px" }}>
  <Icon file={github} color={'#1c1c1c'} scale={10}/>
</div>

Voila! Your icon is now display and can be treated as any other image or text element.

Above example rendered

Opening Links

You can pass any url into the 'link' property of the Icon element, and clicking on the icon will open that link in a new tab.

<Icon file={npm} link="https://www.npmjs.com/package/latest-react-3d-icons" />

Icons

The npm package comes pre-configured with the entire simpleicons.org catalogue.
The import names are lowercase, without spaces, and numbers & periods have been converted to words.
(Ex: Twitter -> twitter, Google Maps -> googlemaps, About.me -> aboutdotme, 1Password -> onepassword)

import { twitter } from "latest-react-3d-icons";

<Icon file="mylogo" />;

Additionally, you can import your own SVGs, and pass references to them into the 'file' property.

React Example:

import { mylogo } from "./icons/logo.svg";

<Icon file="mylogo" />;

Customization

The Icon component comes with properties which you can customize to change how your icon looks and behaves.

| Property | Description | Type | Default Value | Required? | | --------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- | --------------------------------------------------- | ------------- | --------- | | file | The SVG you want to use in your icon. | string | undefined | ✅ | | style | The CSS styles that will applied to the container of the element. | object | {} | | | className | The CSS classes that will be applied to the container of the element. | string | '' | | | color | The color of your icon. | string ('#ff1965') or hexadecimal number (0xff1965) | #000000 | | | lightColor | The color of the light illuminating your icon. | string ('#ff1965') or hexadecimal number (0xff1965) | #ffffff | | | depth | The depth of the extrusion of your icon. | number | 0.5 | | | extrudeSettings | Custom ThreeJS extrusion settings you can apply if you want more control than just depth. See ThreeJS Docs for more info | object | undefined | | | scale | The scale of your icon, some may initially be too small or large. | number | 1 | | | position | An array of the X, Y, and Z positions of your icon in 3d space. | array | [0, 0, 0] | | | rotation | An array of the X, Y, and Z rotation of your icon. Unlike ThreeJS, which uses radian rotation, this uses "normal" degree rotation (Ex: 360 degrees is a full turn) | array | [0, 0, 0] | | | spin | Set to true to make your icon spin in a circle, or set it to a number and increase or decrease it to change the speed of rotation. | number OR boolean | 0 | | | link | If specified, the link that will be opened upon clicking on the icon. | string | undefined | |