Button

  • Shows a button with label or icon.

Features/Functionality

  • Shows a button div with height '45px' and min-width '80px'.
  • Label and icon can be shown as button text.
  • Button will be shown if one of them is given.
  • Will be shown in secondary color. Can be changed to primary through options.
  • Click callback on trigger.
  • Component is container responsive.
  • It is cross browser compatible. (IE11, Edge, Firefox, chrome).

Basic Usage

Dependency

HTML Structure

<require from="{user_path}/buttons/button"></require>
<cst-button label.bind="{label}" icon-name.bind="{iconName}" options.bind="{options}" other-info.bind="{otherInfo}" tooltip.bind="{tooltip}" ext-disabled.bind="{disabled}" evt-click-callback.bind="{evtClickCallback}"></cst-button>

Bindable Properties

Property NameData TypeRequiredDecriptionExample
labelstringYesLabel to be shown on button.label = 'Save'
iconNamestringNoName of the icon to be mapped with classiconName = 'Save'
otherInfoanyNoExtra info to be passed on click
optionsobjectNoOptions for the component
tooltipstringNoValue shown on hover of icontooltip = 'Save Icon'
extDisabledbooleanNoDisables any functionality on component.disabled = true
evtClickCallbackmethodNoMethod to be called when button is clickedevtClickCallback(_evt,_info)

Structure of bindable properties

options

options = {
isPrimaryClr: true, // To give button in primary color
maxChar: '', // To give maximum characters that chave to be shown on button
pageLabel: {}, // Override page labels
pageColorData: {} // Override css colour porperty
}

evtBlurCallback

evtClickCallback(_event,_info);
_info = {
overrideContext: overrideContext,
otherInfo: otherInfo
}

CSS Overrinding

  • Following classes are given to override CSS:
    • .cst-button-container-override : Container Class

Note

  • While giving the classes in page, give them in nested structure.

Rules

Component measurements

Image of measurements

** box-sizing: border-box is used. So width and height will be dimensions + padding.

Working Example

HTML

<template>
<require from="./shared/core_comp/buttons/button"></require>
<div>
<cst-button label.bind="label" icon-name.bind="iconName" options.bind="options" other-info.bind="{otherInfo}" tooltip.bind="tooltip" ext-disabled.bind="disabled" evt-click-callback.bind="evtClickCallback"></cst-button>
</div>
</template>

CSS

.cst-ex-button {
.cst-button-container-override {
width: 100px !important;
height: 70px !important;
}
}

JS

class MyCls{
constructor(){
this.label = "Save";
this.tooltip = "Save";
this.otherInfo = 'Save';
this.iconName = 'Save';
this.options = {
isPrimaryClr:false
}
}
evtBtnClick(_event, _info){
}
}
export { MyCls }

Example Screen Shots

Desktop

Image of Ex


IE Desktop

Image of Ex


Tab

Image of Ex


Mobile

Image of Ex


Demo Link
Demo


Mark down usage
https://guides.github.com/features/mastering-markdown/

VersionDateDeveloped ByInformation ClassificationReviewed ByApproved By
1.005-11-2019GunjanINTERNALPrasan & TarunPrasan