Research
Security News
Malicious npm Package Targets Solana Developers and Hijacks Funds
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
react-icon-cloud-js-testt
Advanced tools
A React component for rendering an interactive image or word cloud on canvas, converted to JavaScript. Based on the original work of Teague Stockwell.
This project is a JavaScript rewrite of the react-icon-cloud in TypeScript by Teague Stockwell.
React component for rendering an interactive img or word cloud on canvas
Code Sandbox
Report Bug
An interactive 3D tag cloud component for React that renders text, images, and simple icons into a interactive 3D tag cloud
Built in support for rendering a cloud of Simple Icons with custom fallback color for poor contrast
Lazy animation of the canvas (pause animation when off screen)
To get a local copy up and running follow these simple steps or see the Code Sandbox.
npm i react-icon-cloud-js
import React from 'react'
import {Cloud, renderSimpleIcon} from 'react-icon-cloud'
import js from "simple-icons/icons/javascript"
import nextjs from "simple-icons/icons/nextdotjs"
const icons = [js,nextjs].map((icon) => {
return renderSimpleIcon({
icon,
size: 42,
aProps: {
onClick: (e: any) => e.preventDefault()
}
})
})
const IconCloud = () => {
return <Cloud>
{icons}
<a>
hello world
</a>
<a
href="https://emojipedia.org/globe-showing-americas/"
target="_blank"
rel="noopener"
>
<img
height="42"
width="42"
alt="A globe"
src="https://emojipedia-us.s3.dualstack.us-west-1.amazonaws.com/thumbs/240/apple/285/globe-showing-americas_1f30e.png"
/>
</a>
</Cloud>
}
import React from 'react'
import {Cloud, renderSimpleIcon, fetchSimpleIcons, SimpleIcon} from 'react-icon-cloud'
const useIcons = (slugs: string[]) => {
const [icons, setIcons] = React.useState()
React.useEffect(() => {fetchSimpleIcons({slugs}).then(setIcons)}, [])
if (icons) {
return Object.values(icons.simpleIcons).map((icon) => renderSimpleIcon({
icon,
size: 42,
aProps: {
onClick: (e: any) => e.preventDefault()
}
}))
}
return <a>Loading</a>
}
const slugs = [
'amazonaws',
'android',
'androidstudio',
'antdesign',
'typescript',
'vercel',
'visualstudiocode'
]
const DynamicIconCloud = () => {
const icons = useIcons(slugs)
return <Cloud>
{icons}
</Cloud>
}
name | type | default | description |
---|---|---|---|
canvasProps | HTMLAttributes < HTMLCanvasElement > | undefined | {} | Attributes that will be passed to the underlying canvas element |
children | Tag[] | [] | Tags rendered using the provided renderers |
containerProps | HTMLAttributes < HTMLDivElement > | undefined | {} | Attributes passed to the root div element |
id | string | number | undefined | uuid | Should be provided when using SSR |
options | IOptions | undefined | {} | https://www.goat1000.com/tagcanvas-options.php |
Used to create a tag for the Cloud component
name | type | default | description |
---|---|---|---|
aProps | HTMLAttributes < HTMLAnchorElement > | undefined | {} | Attributes passed to the underlying anchor element |
bgHex | string | undefined | '#fff' | The string hex of the background the icon will be rendered on. Ex: '#fff'. Used to determine if the min contrast ratio for the icons default color will be met |
fallbackHex | string | undefined | '#000' | The color of the icon if the minContrastRatio is not met Ex: '#000' |
icon | any | undefined | The simple icon object you would like to render. Ex: import icon from "simple-icons/icons/javascript"; |
imgProps | HTMLAttributes < HTMLImageElement > | undefined | {} | Attributes passed to the underlying img element |
minContrastRatio | number | undefined | 1 | 0 - 21 The min contrast ratio between icon and bgHex before the fallbackHex will be used for the icon color |
size | number | undefined | 42 | The size in px of the icon |
Used when you cant statically import simple icons during build time. Calling this will use fetch
to get icons for each provided slug.
name | type | default | description |
---|---|---|---|
slugs | string[] | Slugs to fetch svgs and colors for. The return icons may be passed to renderSimpleIcon |
Dynamically Import Icons With Next.js SSR
See the open issues for a list of proposed features (and known issues).
See LICENSE
for more information.
Teague Stockwell - LinkedIn
FAQs
A React component for rendering an interactive image or word cloud on canvas, converted to JavaScript. Based on the original work of Teague Stockwell.
The npm package react-icon-cloud-js-testt receives a total of 0 weekly downloads. As such, react-icon-cloud-js-testt popularity was classified as not popular.
We found that react-icon-cloud-js-testt demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.
Research
Security News
A malicious npm package targets Solana developers, rerouting funds in 2% of transactions to a hardcoded address.
Security News
Research
Socket researchers have discovered malicious npm packages targeting crypto developers, stealing credentials and wallet data using spyware delivered through typosquats of popular cryptographic libraries.
Security News
Socket's package search now displays weekly downloads for npm packages, helping developers quickly assess popularity and make more informed decisions.