New Research: Supply Chain Attack on Axios Pulls Malicious Dependency from npm.Details
Socket
Book a DemoSign in
Socket

react-heart

Package Overview
Dependencies
Maintainers
1
Versions
7
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

react-heart

SVG based clickable heart button for react with animation options

latest
Source
npmnpm
Version
1.0.6
Version published
Weekly downloads
47
-51.04%
Maintainers
1
Weekly downloads
 
Created
Source

React-Heart

An SVG based, animated and customizable heart button

MIT license npm version npm size

Demo

Live demo and sandbox

Installation

React-Heart is available as an npm package.

// with npm
npm install react-heart

Usage

import React, { useState } from "react"
import Heart from "react-heart"

function App() {
	const [active, setActive] = useState(false)
	return (
		<div style={{ width: "2rem" }}>
			<Heart isActive={active} onClick={() => setActive(!active)}/>
		</div>
	);
}

Props

NameTypeRequired?DefaultDescription
isActiveboolrequiredN/ACurrent heart status
onClickfunctionrequiredN/AHeart was clicked callback
animationTrigger'none' | 'click' | 'hover' | 'both'optional'click'Action that triggers animation
animationScalenumberoptional1.05Scale of animation
animationDurationnumberoptional0.05Length of animation
inactiveColorstringoptional'black'Color of inactive heart
activeColorstringoptional'red'Color of active heart
classNamestringoptionalN/AClass name to apply custom CSS
styleobjectoptionalN/AStyle object

Example

import React, { useState } from "react"
import Heart from "react-heart"

function App() {
	const [active, setActive] = useState(false)
	return (
		<div style={{ width: "2rem" }}>
			<Heart isActive={active} onClick={() => setActive(!active)} animationTrigger = "both" inactiveColor = "rgba(255,125,125,.75)" activeColor = "#e019ae" style = {{marginTop:'1rem'}} animationDuration = {0.1}/>
		</div>
	);
}

Keywords

heart

FAQs

Package last updated on 17 Jan 2021

Did you know?

Socket

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.

Install

Related posts