Security News
Node.js EOL Versions CVE Dubbed the "Worst CVE of the Year" by Security Experts
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
emotion-icons
Advanced tools
Font Awesome, Material Icons, and Octicons available as Emotion Components
(4,680 Total icons)
Feather
by Cole Bemis & ContributorsFontAwesome
by Dave GandyIonicons
by Ben SperryMaterialIcons
by Google, Inc.Octicons
by Github, Inc.SimpleIcons
by Dan Leech & Contributorsboxicons
by Aniket Suvarnaemotion-icons
provides the Font Awesome, Feather, Material Design, and Octicons icon composed with emotion-js.
yarn add emotion-icons
import {material, octicons} from 'emotion-icons'
import Alert from 'emotion-icons/boxicons/Alert'
import {Alert} from 'emotion-icons/boxicons'
import * as faSolid from 'emotion-icons/fa-solid'
Dive Deeper:UNPKG
emotion-icons
│ createIcon.cjs.js
│ createIcon.js
│ index.cjs.js
│ index.js
│
│──boxicons-regular/
│ │ Adjust.cjs.js
│ │ Adjust.js
│ │ ...
│ │ index.cjs.js
│ │ index.js
│──boxicons-regular/
│──boxicons-solid/
│──fa-brands/
│──fa-regular/
│──fa-solid/
│──feather/
│──ion-ios/
│──ion-md/
│──material/
│──octicons/
│──simpleIcons/
import createIcon from "../createIcon";
export var AwardConfig = {
displayName: "Award",
attrs: {
fill: "none",
stroke: "currentColor",
strokeLinecap: "round",
strokeLinejoin: "round"
},
css: {
display: "inline-block",
verticalAlign: "middle",
overflow: "hidden",
maxHeight: "100%",
maxWidth: "100%",
margin: "auto"
},
width: 24,
height: 24,
titleKey: "Award-title",
viewBox: "0 0 24 24",
labelledby: "icon-title-Award",
body: [
{ type: "circle", props: { cx: 12, cy: 8, r: 7, key: "k0" } },
{
type: "polyline",
props: { points: "8.21 13.89 7 23 12 20 17 23 15.79 13.88", key: "k1" }
}
]
};
export default createIcon(AwardConfig);
import React from 'react'
import styled from '@emotion/styled'
import isPropValid from '@emotion/is-prop-valid'
const createInnerElements = body =>
body.map(item => React.createElement(item.type, {...item.props}))
function calcRatio(value, ratio = 1) {
if (typeof ratio !== 'number') return value
if (typeof value === 'number') return value * ratio
const unitlessValue = parseFloat(value)
return unitlessValue * ratio + value.replace(`${unitlessValue}`, '')
}
const calcDimension = (key, {size, ratio, ...HW}) => {
const targetV = HW[key]
const value = size
? ratio
? calcRatio(size, ratio)
: size
: targetV
? ratio
? calcRatio(targetV, ratio)
: targetV
: null
return value ? {[key]: value} : {}
}
const createIcon = config => {
const Inner = createInnerElements(config.body)
const StyledIcon = styled('svg', {
shouldForwardProp: name =>
!['width', 'size', 'height', 'css', 'color'].includes(name) && isPropValid(name),
})(
({
size,
ratio,
height = config['height'],
width = config['width'],
css,
color = config['color'],
}) => ({
...config.css,
...calcDimension('height', {size, ratio, height, width}),
...calcDimension('width', {size, ratio, height, width}),
...(color ? {color} : {}),
...css,
}),
)
const Icon = ({title, ...restProps}) => {
const passProps = {
viewBox: config.viewBox,
'aria-hidden': title ? null : 'true',
'aria-labelledby': title && config.labelledby,
focusable: 'false',
role: title ? undefined : 'img',
...config.attrs,
...restProps,
}
return (
<StyledIcon {...passProps}>
{title && <title key={config.titleKey}>{title}</title>}
{Inner}
</StyledIcon>
)
}
Icon.displayName = config.displayName
Icon.defaultProps = config.defaultProps
return Icon
}
export default createIcon
FAQs
Icons from packs like Font Awesome, Material, Octicons, Feather, Icomoon, and Boxicons available as Emotion Components
The npm package emotion-icons receives a total of 650 weekly downloads. As such, emotion-icons popularity was classified as not popular.
We found that emotion-icons demonstrated a not healthy version release cadence and project activity because the last version was released a year ago. It has 3 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.
Security News
Critics call the Node.js EOL CVE a misuse of the system, sparking debate over CVE standards and the growing noise in vulnerability databases.
Security News
cURL and Go security teams are publicly rejecting CVSS as flawed for assessing vulnerabilities and are calling for more accurate, context-aware approaches.
Security News
Bun 1.2 enhances its JavaScript runtime with 90% Node.js compatibility, built-in S3 and Postgres support, HTML Imports, and faster, cloud-first performance.