@squiz/xaccel-assisted-button
TypeScript icon, indicating that this package has built-in type declarations

1.15.1-beta.0 • Public • Published

Assisted Button

Description

This component will create button or anchor tag with the settings provided by the user. It can be used in any other repository.

Components properties

Property Property description Property type IsRequired
buttonType Item type - button or a string [x]
classObject The object of class names classNameOverride
...jsxElementProps button or anchor attributes strings

Conditional component presentation

  • Displaying anchor: To display anchor tag please set buttonType to 'a'.
  • Displaying button: To display button tag please set buttonType to 'button'

Props Example:

<AssistedButton
  buttonType="button"
  onClick={() => console.log('test console.log')}
  classObject={{
    className: "storybook-button",
    cssModule: {
      'storybook-button__wrapper': 'button__wrapper--customForTest',
    },
    replaceBaseClass: false,
    retainMissingModuleClasses: true,
  }}
>
  Click me
</AssistedButton>

For more information about classObject please visit packages/utility/functions/src/generateClasses.js

Usage

Install the package by running: npm i @squiz/xaccel-assisted-button

import AssistedButton from '@squiz/xaccel-assisted-button';

function SomeReactComponent() {
    <AssistedButton buttonType='button'
        classObject= {{
            className: `custom-class`,
            replaceBaseClass: false,
            retainMissingModuleClasses: true,
        }}
        onClick={() => console.log('test console.log')}
    >
        <span>Test text</span>
    </AssistedButton>
}

Readme

Keywords

none

Package Sidebar

Install

npm i @squiz/xaccel-assisted-button

Weekly Downloads

43

Version

1.15.1-beta.0

License

ISC

Unpacked Size

29.3 kB

Total Files

8

Last publish

Collaborators

  • squiz-npm-publish
  • cdloh
  • pcoshansquiz
  • tadams_squiz
  • abarnes_squiz
  • gsherwood
  • pnolland
  • chadszinow-squiz
  • deborahsherwood
  • griseborough
  • akarelia
  • sdanis
  • tbernardes
  • oliverneal
  • azakens
  • azenderowska.squiz
  • lnowak
  • mdobie
  • bmatters
  • ewyatt
  • lwright-sq
  • cupreti
  • jmatthew_squiz
  • wjarosz
  • bxwu
  • carlfoster
  • samort
  • yyang1029
  • squiz-dwebster
  • tsmyth
  • aqureshi-sqz
  • rainger_squiz
  • ajhawar
  • hlee_squiz_npm
  • uqureshi
  • thomasgrob
  • avanschoor-squiz
  • ata-squiz
  • asharpe-squiz
  • aj12
  • squiz-lstephan
  • squiz-ncallahan
  • squiz-dschoen
  • squiz-ksilalahi
  • jpolgar-squiz
  • pkiriakou
  • hnarayanasamy
  • rmcavoy-squiz
  • asittirangsan
  • jchaware
  • lunowak-squiz
  • mnowakowski1
  • sholloway
  • pantyporowicz-squiz
  • djarrott.squiz.net
  • dkaczmarek
  • lineenan
  • aaronchan1010
  • haleesquiz
  • dpedroso
  • rszarafinski
  • tmadden
  • zackyang214
  • gdemelloesilva.squiz
  • jwrobel
  • bpottier
  • hkapoor_squiz
  • jhendersonsquiz
  • joshsquiz
  • dstaskiewicz
  • cross-squiz
  • sjamesquiz
  • dheffernan