Questions tagged [react-icons]

Usage

import { FaBeer } from 'react-icons/fa';

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

Docs.

146 questions
0
votes
1 answer

import dynamically react icons

I need to import a icon dynamically with the props will receive in the component and return the icon compatible with this, i have a question about this: import { useEffect, useState } from 'react'; export default function Icon({ libraryName,…
vazquezdev
  • 41
  • 6
0
votes
1 answer

react-icons set size prop of Icon in child

What I would like to do but isn't possible is something like this: import { FaBook } from 'react-icons/fa'; const Parent = () => Save; Then in the child const Child = ({ icon }) => (
hoan
  • 1,277
  • 3
  • 18
  • 32
0
votes
0 answers

An unexpected error, please what should i do?

Failed to compile. Module not found: Error: Can't resolve 'react-icons/fa' in 'C:\Users\Damola Gbenga\Documents\chat-app\src\components' ERROR in ./src/components/Sidebar.jsx 7:0-44 Module not found: Error: Can't resolve 'react-icons/fa' in…
Gbeemiga
  • 1
  • 1
0
votes
1 answer

Stroke not applied to React-Icons

Stroke or Text nothing is applied with react-icons handleBurger(e)} />
sohanemon
  • 15
  • 6
0
votes
2 answers

onclick button toggle icon not working in reactjs

Here i try to toggle react icons when click the button but it still not working: Here is my code: const [anchorEl, setAnchorEl] = useState(null); const open = Boolean(anchorEl); const handleClick = (event) => { …
Shawn
  • 1,232
  • 1
  • 14
  • 44
0
votes
2 answers

how to import all icons in Material Design from react-icons

I could not find anywhere in the documentation and on google how to use import * as MaterialDesign from "react-icons/" in the render fonction. Thank you for understanding.
IsraelCena
  • 29
  • 1
  • 6
0
votes
1 answer

Change react-icon color when hover not working properly

I'm trying to change my react icon's color while hover on it. Its only partilly working right now. If mouse is over blank part of the icon then its not changing color. Any suggestions are welcome. Thanks
Lin L
  • 1
  • 1
0
votes
2 answers

Icons from react-icons with classes name instead of component

Is there a way in React Icons to specify my icons as a string, for example for the class name? Currently I am using a React UI library which requires the names of the icons to be passed as their classes. I know that you can use icons using…
user17145524
  • 227
  • 4
  • 10
0
votes
1 answer

Import React Icons- FiMoreHorizontal - Error

Following a tutorial to build a Twitter clone and I have to import: import { FiMoreHorizontal } from 'react-icons/fi' 2.3K (gzipped: 1K) import { VscTwitter } from 'react-icons/vsc' 3.1K (gzipped: 1.5K) I get this..... Error: error: Identifier…
dustycar17
  • 27
  • 6
0
votes
1 answer

react-icons module causing next.js ReferenceError: document is not defined

So as the title said, I tried to use react-icons module but it causing reference error. I installed the module with command yarn add…
BlueBeret
  • 474
  • 3
  • 23
0
votes
1 answer

css can't override react icon color

A simple illustration of my problem import {BsFillArrowRightCircleFill} from "react-icons/bs"; export default function Icon(){ return ; } In the CSS file, if I put .icon { color: red; } it…
Veritas1832
  • 67
  • 3
  • 14
0
votes
0 answers

Modify calendar icon to close icon input type date react

Hi, I have been using useState inside react, when date is selected. But, if the date is empty or null I want to modify the calendar icon to close icon. when close icon is clicked it should clear the state. const [selectedDate, setSelectedDate] =…
ReactDev
  • 21
  • 4
0
votes
1 answer

How to dynamically change the size of icon in

currently, to style my icons under the 'react-icons' library, I am using the 'IconContext.Provider' tag. However, is there a solution for me to change the size of the icon dynamically based on the size of my media ? Is the only solution to go about…
Shreamy
  • 341
  • 2
  • 16
0
votes
1 answer

why my react-icon cannot be centered in the button?

Hi guys so I'm trying to create scroll to Top button in react.js and I have manage to finished the component but the problem is I can't make the icon vertically center on the circle button. How can I fix it ? I've tried to align the item to center.…
Kim San
  • 575
  • 7
  • 22
0
votes
1 answer

Icon is not exported from react-icons and compiler error is shown

I installed react-icons but it is not working error: FaBeer not exported import '../style/mobHeader.css' import { FaBeer } from 'react-icons/fa'; const Mobileheader = () => { return (