1.0.11 • Published 3 years ago

yogawa-custom-button v1.0.11

Weekly downloads
-
License
-
Repository
github
Last release
3 years ago

npm version

CustomButton

CustomButton is a very simple button component that you can customize for your needs

How to install

Via npm

npm install yogawa-custom-button

Via yarn

yarn add yogawa-custom-button

How to use

Import the module

import { CustomButtonModule } from 'yogawa-custom-button';

@NgModule({
  ...
  imports: [
    CustomButtonModule
  ],
  ...
})
Create configuration object of CustomButtonConfig type
import { CustomButtonConfig } from 'yogawa-custom-button';

config: CustomButtonConfig = {
  theme: 'black',
  label: 'Click me',
  title: 'Sample button',
  disabled: false,
  size: 'lg',
  showTooltip: true,
  tooltipText: "Please click me",
  tabIndex: 0,
  borderRadius: '1rem',
}

onClick($event: Event) {
  console.log($event);
  alert("Hello world");
}

Use it ion your template

<custom-button [config]="config" (onClick)="onClick($event)"></custom-button>

Parameters

parametertyperequired?defaultexampleremark
labelstringyes'Click me'
titlestringno'Sample button'
disabledbooleannofalsetrue
size'sm' | 'lg' | 'responsive'no'lg'
showTooltipbooleannofalsetrue
tooltipTextstringno'Please click me'
tabIndexnumberno1
theme'red' | 'green' | 'blue' | 'yellow' | 'black'no'black'
1.0.11

3 years ago

1.0.10

3 years ago

1.0.9

3 years ago

1.0.8

3 years ago

1.0.7

3 years ago

1.0.6

3 years ago

1.0.5

3 years ago

1.0.4

3 years ago

1.0.3

3 years ago

1.0.2

3 years ago

1.0.1

3 years ago

1.0.0

3 years ago