How to use styled-icons - 1 common examples

To help you get started, we’ve selected a few styled-icons examples, based on popular ways it is used in public projects.

Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.

github jacobwgillespie / styled-icons / packages / website / src / components / IconExplorer.tsx View on Github external
remixFill,
  remixLine,
} from 'styled-icons'
import iconManifest from 'styled-icons/manifest.json'

import {IconCard} from './IconCard'

interface IconType {
  importPath: string
  name: string
  originalName: string
  pack: string
  icon: StyledIcon
}

const icons = iconManifest.map(
  (icon: any): IconType => {
    switch (icon.pack) {
      case 'boxicons-logos':
        return {...icon, icon: boxiconsLogos[icon.name as keyof typeof boxiconsLogos]}

      case 'boxicons-regular':
        return {...icon, icon: boxiconsRegular[icon.name as keyof typeof boxiconsRegular]}

      case 'boxicons-solid':
        return {...icon, icon: boxiconsSolid[icon.name as keyof typeof boxiconsSolid]}

      case 'crypto':
        return {...icon, icon: crypto[icon.name as keyof typeof crypto]}

      case 'evil':
        return {...icon, icon: evil[icon.name as keyof typeof evil]}

styled-icons

Icons from packs like Font Awesome, Material, Octicons, Feather, Icomoon, and Boxicons available as Styled Components

MIT
Latest version published 7 months ago

Package Health Score

70 / 100
Full package analysis

Popular styled-icons functions