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

@react-sandbox/heart

Package Overview
Dependencies
Maintainers
1
Versions
2
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@react-sandbox/heart

Animated heart button

latest
Source
npmnpm
Version
1.1.0
Version published
Maintainers
1
Created
Source

@react-sandbox/heart

Build status Dependencies Build size Package downloads

Example

❤️ Animated heart button.

Usage

Install

Install the @react-sandbox/heart package:

npm install @react-sandbox/heart

Import

Import the Heart component:

import React, { useState } from 'react'
import Heart from '@react-sandbox/heart'

function App() {
  const [active, setActive] = useState(false)

  return (
    <div>
      <Heart
        width={24}
        height={24}
        active={active}
        onClick={() => setActive(!active)}
      />
    </div>
  )
}

Props

PropTypeDefaultDescription
widthnumberrequiredHeart width
heightnumberrequiredHeart height
activebooleanrequiredHeart fill & animation
onClickfunctionrequiredClick callback function
activeColorstring'#ff0000'Active color
inactiveColorstring'#121212'Inactive color
strokeWidthnumber30Outline stroke width
disabledbooleanfalseDisable usage
ariaLabelstring'Like'Accessibility label
classNamestring-CSS classes
styleReact.CSSProperties-CSS styles

Development

Local

pnpm install
pnpm dev

Tests

pnpm test

Example

Inside test/:

pnpm install
pnpm dev

License

MIT

Keywords

react

FAQs

Package last updated on 14 Mar 2024

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