1.15.1-beta.0 • Published 1 year ago
@squiz/xaccel-assisted-button v1.15.1-beta.0
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>
}
1.15.0
1 year ago
1.15.1-beta.0
1 year ago
1.14.0-alpha.1
1 year ago
1.15.0-beta.1
1 year ago
1.14.1-beta.0
1 year ago
1.14.0
1 year ago
1.13.1
1 year ago
1.14.0-beta.0
1 year ago
1.13.0-beta.2
1 year ago
1.13.0-alpha.7
1 year ago
1.12.2
1 year ago
1.12.1-beta.3
1 year ago
1.12.1
1 year ago
1.12.1-beta.2
1 year ago
1.13.0-beta.1
1 year ago
1.13.0-alpha.4
1 year ago
1.13.0-alpha.5
1 year ago
1.9.1-alpha.0
1 year ago
1.12.1-alpha.0
1 year ago
1.12.1-alpha.1
1 year ago
1.9.1-beta.0
1 year ago
1.12.1-beta.0
1 year ago
1.9.0
1 year ago
1.9.0-beta.36
1 year ago
1.10.0-alpha.12
2 years ago
1.10.0-alpha.10
2 years ago
1.9.0-beta.19
2 years ago
1.10.0-alpha.6
2 years ago
1.9.0-beta.16
2 years ago
1.9.0-beta.15
2 years ago
1.10.0-alpha.5
2 years ago
1.9.0-beta.14
2 years ago
1.9.0-beta.13
2 years ago