yogawa-custom-button
TypeScript icon, indicating that this package has built-in type declarations

1.0.11 • Public • Published

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

parameter type required? default example remark
label string yes 'Click me'
title string no 'Sample button'
disabled boolean no false true
size 'sm' | 'lg' | 'responsive' no 'lg'
showTooltip boolean no false true
tooltipText string no 'Please click me'
tabIndex number no 1
theme 'red' | 'green' | 'blue' | 'yellow' | 'black' no 'black'

Readme

Keywords

none

Package Sidebar

Install

npm i yogawa-custom-button

Weekly Downloads

24

Version

1.0.11

License

none

Unpacked Size

75.6 kB

Total Files

16

Last publish

Collaborators

  • yogawa92