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