Socket
Socket
Sign inDemoInstall

@acctglobal/buy-button

Package Overview
Dependencies
3
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Install Socket

Detect and block malicious and high-risk dependencies

Install

    @acctglobal/buy-button

## Getting Started


Version published
Weekly downloads
46
increased by9.52%
Maintainers
3
Install size
15.3 kB
Created
Weekly downloads
 

Readme

Source

Buy Button

Getting Started

  • Install package
yarn add @acctglobal/buy-button # or npm install
  • Import component
import BuyButton from '@acctglobal/buy-button';

Use case example

  • Just call the component and pass with a children to customize label.
const buttonStyles;

<BuyButton handleBuy={handleBuyFunction} styles={buttonStyles}>Add to cart</BuyButton>

Props

ParameterTypeDescription
handleBuyfunctionMandatory. onClick function to the button
stylesCSS objectOptional. Object containing styles for the button

Styling

There are two ways to customize the component

By prop styles
const buttonStyles = {
   backgroundColor: 'blue',
   color: 'white',
   border: 0,
   padding: '0.5rem',
   borderRadius: '4px',
 },

<BuyButton handleBuy={handleBuyFunction} styles={buttonStyles}>Add to cart</BuyButton>
By attribute

data-sf-buy-button

On your style file (style.css):

[data-sf-buy-button] {
  background-color: #fff;
}

FAQs

Last updated on 05 Jul 2022

Did you know?

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

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc