react-icons/fi APIs
- FiTrash2
- FiArrowLeft
- FiUsers
- FiLogIn
- FiPower
- FiX
- FiSun
- FiSearch
- FiPlus
- FiMail
- FiMoon
- FiEdit
- FiChevronRight
- FiShare2
- FiCheckCircle
- FiChevronLeft
- FiLink
- FiLogOut
- FiArrowRight
- FiMenu
- FiGlobe
- FiCheck
- FiSend
- FiFile
- FiInfo
- FiCopy
- FiDownload
- FiTrash
- FiExternalLink
- FiClock
- FiEye
- FiAlertTriangle
- FiShare
- FiChevronDown
- FiMap
- FiLock
- FiHome
- FiPackage
- FiTwitter
- FiGrid
- FiPlusCircle
- FiXCircle
- FiCrosshair
- FiUserPlus
- FiMusic
- FiCode
- FiBookOpen
- FiCodepen
- FiEyeOff
- FiFolderPlus
- FiCoffee
- FiImage
- FiUpload
- FiArchive
- FiCalendar
- FiUser
- FiWind
- FiRewind
- FiMinus
- FiBell
- FiChevronUp
- FiHeart
- FiStar
- FiHelpCircle
- FiFileText
- FiAlertOctagon
- FiTag
- FiTerminal
- FiArrowLeftCircle
- FiArrowRightCircle
- FiBook
- FiPhoneCall
- FiLink2
- FiGithub
- FiLinkedin
- FiYoutube
- FiMoreVertical
- FiPauseCircle
- FiPlayCircle
- FiFolder
- FiVideo
- FiLoader
- FiHardDrive
- FiUnlock
- FiPhone
- FiAtSign
- FiCircle
- FiPlay
- FiDownloadCloud
- FiMessageCircle
- FiBookmark
- FiAperture
- FiPhoneForwarded
- FiShuffle
- FiWatch
- FiCloud
- FiCloudDrizzle
- FiCloudRain
- FiCloudLightning
- FiCloudSnow
- FiShoppingCart
- FiFilter
- FiCornerUpLeft
- FiShoppingBag
- FiCornerDownRight
- FiEdit3
- FiMessageSquare
- FiInbox
- FiTool
- FiMinusCircle
OtherRelated APIs
react-icons/fi#FiCloudDrizzle JavaScript Examples
The following examples show how to use
react-icons/fi#FiCloudDrizzle.
You can vote up the ones you like or vote down the ones you don't like,
and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example #1
Source File: Weather.jsx From 4IZ268-2021-2022-ZS with MIT License | 5 votes |
function Weather() {
const [info, setInfo] = useState([])
const [icon, setIcon] = useState('')
const [error, setError] = useState(null)
const [isLoaded, setIsLoaded] = useState(false)
useEffect(() => {
fetch(WEATHER_INFO)
.then((res) => res.json())
.then(
(result) => {
setInfo(result)
setIcon(parseIcon(result.weather[0].icon))
setIsLoaded(true)
},
(error) => {
setIsLoaded(true)
setError(error)
}
)
}, [])
function parseIcon(input) {
const iconId = input.slice(0, 2)
return iconId
}
if (error) {
return <div>Error: {error.message}</div>
} else if (!isLoaded) {
return (
<div className='pr-4 pt-3 pb-16 pl-28 opacity-0'>
<p className='h-14'>Loading...</p>
</div>
)
}
return (
<div className='group pr-4 pt-3 pb-16 pl-28 opacity-70 hover:opacity-90 transition-opacity'>
<div className='flex items-center gap-x-2'>
{icon === '01' && <FiSun size='2em' />}
{(icon === '02' || icon === '03' || icon === '04') && (
<FiCloud size='2em' />
)}
{icon === '09' && <FiCloudDrizzle size='2em' />}
{icon === '10' && <FiCloudRain size='2em' />}
{icon === '11' && <FiCloudLightning size='2em' />}
{icon === '13' && <FiCloudSnow size='2em' />}
{icon === '50' && <FiWind size='2em' />}
<p className='font-medium text-2xl'>{Math.round(info.main.temp)} °C</p>
</div>
<p className='text-center opacity-80'>{info.name}</p>
</div>
)
}