Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

bpk-component-button

Package Overview
Dependencies
Maintainers
6
Versions
562
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

bpk-component-button

Backpack button component.

  • 7.0.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
14
decreased by-94.04%
Maintainers
6
Weekly downloads
 
Created
Source

bpk-component-button

Backpack button component.

Installation

npm install bpk-component-button --save-dev

Usage

import React from 'react';
import { withButtonAlignment, withRtlSupport } from 'bpk-component-icon';
import ArrowIcon from 'bpk-component-icon/sm/long-arrow-right';
import BpkButton from 'bpk-component-button';

const AlignedArrowIcon = withButtonAlignment(withRtlSupport(ArrowIcon));

export default () => (
  <div>
    <BpkButton>Primary</BpkButton>
    <BpkButton large>Large primary</BpkButton>
    <BpkButton secondary>Secondary</BpkButton>
    <BpkButton secondaryOnDark>SecondaryOnDark</BpkButton>
    <BpkButton link>Link</BpkButton>
    <BpkButton linkOnDark>LinkOnDark</BpkButton>
    <BpkButton outline>Outline (Deprecated, use PrimaryOnDark or PrimaryOnLight instead)</BpkButton>
    <BpkButton primaryOnDark>PrimaryOnDark</BpkButton>
    <BpkButton primaryOnLight>PrimaryOnLight</BpkButton>
    <BpkButton iconOnly>
      <AlignedArrowIcon />
      <span className="visually-hidden">Search</span>
    </BpkButton>
  </div>
);

Props

PropertyPropTypeRequiredDefault Value
children-true-
destructiveboolfalsefalse
featuredboolfalsefalse
linkboolfalsefalse
linkOnDarkboolfalsefalse
outlinebool (deprecated)falsefalse
secondaryboolfalsefalse
secondaryOnDarkboolfalsefalse
primaryOnDarkboolfalsefalse
primaryOnLightboolfalsefalse
blankboolfalsefalse
classNamestringfalsenull
disabledboolfalsefalse
hrefstringfalsenull
iconOnlyboolfalsefalse
largeboolfalsefalse
onClickfuncfalsenull
relstringfalsenull
submitboolfalsefalse

Theme Props

Primary:

  • buttonPrimaryTextColor
  • buttonPrimaryHoverTextColor
  • buttonPrimaryActiveTextColor
  • buttonPrimaryGradientStartColor
  • buttonPrimaryGradientEndColor
  • buttonPrimaryBackgroundColor
  • buttonPrimaryHoverBackgroundColor
  • buttonPrimaryActiveBackgroundColor

Primary on dark:

  • buttonPrimaryOnDarkTextColor
  • buttonPrimaryOnDarkHoverTextColor
  • buttonPrimaryOnDarkActiveTextColor
  • buttonPrimaryOnDarkBackgroundColor
  • buttonPrimaryOnDarkHoverBackgroundColor
  • buttonPrimaryOnDarkActiveBackgroundColor

Primary on light:

  • buttonPrimaryOnLightTextColor
  • buttonPrimaryOnLightHoverTextColor
  • buttonPrimaryOnLightActiveTextColor
  • buttonPrimaryOnLightBackgroundColor
  • buttonPrimaryOnLightHoverBackgroundColor
  • buttonPrimaryOnLightActiveBackgroundColor

Secondary:

  • buttonSecondaryTextColor
  • buttonSecondaryHoverTextColor
  • buttonSecondaryActiveTextColor
  • buttonSecondaryBorderColor
  • buttonSecondaryHoverBorderColor
  • buttonSecondaryActiveBorderColor
  • buttonSecondaryBackgroundColor
  • buttonSecondaryHoverBackgroundColor
  • buttonSecondaryActiveBackgroundColor

Secondary on dark:

  • buttonSecondaryOnDarkTextColor
  • buttonSecondaryOnDarkHoverTextColor
  • buttonSecondaryOnDarkActiveTextColor
  • buttonSecondaryOnDarkBackgroundColor
  • buttonSecondaryOnDarkHoverBackgroundColor
  • buttonSecondaryOnDarkActiveBackgroundColor
  • buttonFeaturedTextColor
  • buttonFeaturedHoverTextColor
  • buttonFeaturedActiveTextColor
  • buttonFeaturedGradientStartColor
  • buttonFeaturedGradientEndColor
  • buttonFeaturedBackgroundColor
  • buttonFeaturedHoverBackgroundColor
  • buttonFeaturedActiveBackgroundColor

Destructive:

  • buttonDestructiveTextColor
  • buttonDestructiveHoverTextColor
  • buttonDestructiveActiveTextColor
  • buttonDestructiveBorderColor
  • buttonDestructiveHoverBorderColor
  • buttonDestructiveActiveBorderColor
  • buttonDestructiveBackgroundColor
  • buttonDestructiveHoverBackgroundColor
  • buttonDestructiveActiveBackgroundColor

All button types:

  • buttonFontSize (Optional)

FAQs

Package last updated on 05 Aug 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

SocketSocket SOC 2 Logo

Product

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

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc