🚀 DAY 5 OF LAUNCH WEEK:Introducing Webhook Events for Alert Changes.Learn more →
Socket
Book a DemoInstallSign in
Socket

@acctglobal/buy-button

Package Overview
Dependencies
Maintainers
3
Versions
9
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@acctglobal/buy-button

## Getting Started

latest
npmnpm
Version
1.0.3
Version published
Weekly downloads
37
-35.09%
Maintainers
3
Weekly downloads
 
Created
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

Package last updated on 05 Jul 2022

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