6.2.3 • Published 2 years ago

bpk-component-button-css v6.2.3

Weekly downloads
198
License
Apache-2.0
Repository
github
Last release
2 years ago

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

Featured:

  • buttonFeaturedTextColor
  • buttonFeaturedHoverTextColor
  • buttonFeaturedActiveTextColor
  • buttonFeaturedGradientStartColor
  • buttonFeaturedGradientEndColor
  • buttonFeaturedBackgroundColor
  • buttonFeaturedHoverBackgroundColor
  • buttonFeaturedActiveBackgroundColor

Destructive:

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

All button types:

  • buttonFontSize (Optional)
6.2.3

2 years ago

6.1.0

2 years ago

6.2.1

2 years ago

5.1.1

2 years ago

6.0.1

2 years ago

5.1.0

2 years ago

5.0.24

2 years ago

5.0.25

2 years ago

5.0.26

2 years ago

5.0.29

2 years ago

5.0.15

2 years ago

5.0.16

2 years ago

5.0.18

2 years ago

5.0.14

3 years ago

5.0.10

3 years ago

5.0.7

3 years ago

5.0.5

3 years ago

5.0.4

3 years ago

5.0.3

3 years ago

5.0.2

3 years ago

5.0.1

3 years ago

5.0.0

3 years ago

4.0.0

3 years ago

3.4.7

3 years ago

3.4.5

3 years ago

3.4.4

3 years ago

3.4.3

3 years ago

3.4.2

3 years ago

3.4.1

3 years ago

3.4.0

3 years ago

3.3.32

3 years ago

3.3.33

3 years ago

3.3.31

3 years ago

3.3.30

3 years ago

3.3.29

3 years ago

3.3.26

3 years ago

3.3.27

3 years ago

3.3.28

3 years ago

3.3.25

3 years ago

3.3.24

3 years ago

3.3.23

3 years ago

3.3.22

3 years ago

3.3.21

3 years ago

3.3.20

3 years ago

3.3.19

3 years ago

3.3.18

3 years ago

3.3.17

3 years ago

3.3.15

3 years ago

3.3.16

3 years ago

3.3.14

3 years ago

3.3.13

3 years ago

3.3.12

3 years ago

3.3.11

3 years ago

3.3.10

3 years ago

3.3.9

3 years ago

3.3.8

3 years ago

3.3.7

3 years ago

3.3.6

3 years ago

3.3.5

3 years ago

3.3.2

3 years ago

3.3.1

4 years ago

3.3.0

4 years ago

3.2.67

4 years ago

3.2.66

4 years ago

3.2.64

4 years ago

3.2.63

4 years ago

3.2.62

4 years ago

3.2.61

4 years ago

3.2.60

4 years ago

3.2.59

4 years ago

3.2.57

4 years ago

3.2.56

4 years ago

3.2.55

4 years ago

3.2.50

4 years ago

3.2.49

4 years ago

3.2.48

4 years ago

3.2.46

4 years ago

3.2.45

4 years ago

3.2.44

4 years ago

3.2.43

4 years ago