Skip to content

UrielCh/react-icons

Repository files navigation

preact version of react-icons

JSR

This library is preact version of react-icons build to be use with deno fresh project.

All icons available can be test here click on the icon you want the copy the import statement to your code.

If you have time to help the project is here

Setup

install the bundle you want using

deno add @preact-icons/ai for deno

npx jsr add @preact-icons/ai for npm

bunx jsr add @preact-icons/ai for bun

update your dependency tu use only jsr / npm source

replace http imports like:

{
  "preact": "https://esm.sh/[email protected]",
  "preact/": "https://esm.sh/[email protected]/",
}

by npm imports like:

{
    "preact": "npm:[email protected]",
    "preact/jsx-runtime": "npm:[email protected]/jsx-runtime",
    "preact/hooks": "npm:[email protected]/hooks",
}

you can now import a single icon using:

import AiTwotonePrinter from "@preact-icons/ai/AiTwotonePrinter";

sample

deno add @preact-icons/ai
import { AiFillAccountBook } from "@preact-icons/ai";

export default function TesSvg() {
  return (<AiFillAccountBook />)
}

Check the full documetation in: here

the first sample:

import { FaBeer } from 'react-icons/fa';
class Question extends React.Component {
  render() {
    return <h3> Lets go for a <FaBeer />? </h3>
  }
}

can be convert as:

import { FaBeer } from '@preact-icons/fa';
// or 
import FaBeer from '@preact-icons/fa/FaBeer';

import { Component } from 'preact'

class Question extends Component {
  render() {
    return <h3> Lets go for a <FaBeer />? </h3>
  }
}

references

About

react-icons ported for deno / preact

Resources

License

Stars

Watchers

Forks

Packages

No packages published