button/src/button/button.component.ts
Button in different sizes and style variants.
Example :<button talenra-button label="Button Label"></button>
<button talenra-button label="Submit" kind="secondary" size="s" disabled type="submit"></button>If a Button's width is limited (e.g by CSS or a parent element), the label is truncated as required (using ellipsis).
label to set the Button's label.The button's kind determines its visual style.
The button's size determines its height and font-size.
Buttons can have an optional icon. If used in combination with a label, the icon is always placed on the left side of the label.
Example :<button talenra-button label="Reload" icon="refresh"></button>To render an icon-only button, just omit the label text. The icon will be rendered in the center of the button.
Example :<button talenra-button size="s" icon="refresh"></button>While waiting is true, the button's label and icon are hidden and a loading indicator (spinner) is presented to the
user instead.
<button talenra-button label="My Label" waiting></button>
<button talenra-button label="My Label" [waiting]="myCondition"></button>import { ButtonComponent } from '@talenra/components/button';
| changeDetection | ChangeDetectionStrategy.OnPush |
| host | { |
| selector | button[talenra-button] |
| imports |
IconComponent
SpinnerComponent
|
| styleUrls | ./button.component.scss |
| templateUrl | ./button.component.html |
Methods |
|
Inputs |
| icon |
Type : string
|
Default value : ''
|
|
The name of the icon to be rendered. e.g. See IconComponent |
| kind |
Type : TButtonKind
|
Default value : ButtonKind.Primary
|
|
Determines the visual kind of button to be rendered. Example :See ButtonKind |
| label |
Type : string
|
Default value : ''
|
|
The button's label presented to the user. Example : |
| size |
Type : TButtonSize
|
Default value : ButtonSize.M
|
|
Determines the size or the "visual weight" of the button. Currently affects the button's height only. Example :See ButtonSize |
| Public focus |
focus()
|
|
Sets the focus to the button.
Returns :
void
|
https://gitlab.svanet.ch/talenra/talenra-workspace/-/merge_requests/756
hasFocus property@Input decorator with input signalundefined. Use empty string instead.