Button

cf-button

CF Button has two features that makes it special. The fact that you can pass and icon name and position to the button and it renders is automatically, as well as having a waiting state.

Basic Usage

<!-- Example of a simple button with just a label -->
<cf-button label="Press Me"></cf-icon>

<!-- Example of a button with an icon -->
<cf-button label="Close" iconName="close" iconPosition="left"></cf-icon>

Waiting State

app.html

<cf-button label="Reload" [waitingButton]="myWaitingState"></cf-icon>

app.ts

waitingIcon = {
    name: "fa-spinner",
    type: "fa",
    size: "20px"
}

myWaitingState = {
    value: true, // can be of type any
    disabled: true, // disable or enable button when waiting
    iconProperty: this.waitingIcon
}

Properties and Styling

app.html

app.ts

Input Properties

Attr

Type

Details

display

boolean

If true, the icon will be displayed else the icon will be hidden. By default it's value is true

disabled

boolean

If true the button will be disabled. By default it's value is false

label

string

Label to be displayed on the button

iconName

string

Name of the icon, material or font aweesome name.

iconPosition

string

Position of the icon, by default it's on the left

waitingButton

any

Object with 3 attributes: value, disabled, iconProperty. Activated when the button is clicked.

Last updated