Skip to content
angulux
@anguless/angulux/button

button

4 declarations7 demos
import
import { ButtonModule } from '@anguless/angulux/button';

Basic

Text to display on a button is defined with the label property.

<agl-button label="Submit" />

Directive

Button can also be used as a directive with aglButton, together with the aglButtonLabel and aglButtonIcon helpers.

<button aglButton>    <i class="pi pi-check" aglButtonIcon></i>    <span aglButtonLabel>Save</span></button>

Severity

Severity defines the type of button.

<agl-button label="Primary" /><agl-button label="Secondary" severity="secondary" /><agl-button label="Success" severity="success" /><agl-button label="Info" severity="info" /><agl-button label="Warn" severity="warn" /><agl-button label="Help" severity="help" /><agl-button label="Danger" severity="danger" /><agl-button label="Contrast" severity="contrast" />

Icons

The icon of a button is specified with the icon property, and its position is configured with iconPos.

<agl-button icon="pi pi-home" ariaLabel="Home" /><agl-button label="Profile" icon="pi pi-user" /><agl-button label="Save" icon="pi pi-check" iconPos="right" /><agl-button label="Search" icon="pi pi-search" iconPos="top" /><agl-button label="Update" icon="pi pi-refresh" iconPos="bottom" />

Sizes

Button provides small and large sizes as alternatives to the standard.

<agl-button label="Small" icon="pi pi-check" size="small" /><agl-button label="Normal" icon="pi pi-check" /><agl-button label="Large" icon="pi pi-check" size="large" />

Loading

Busy state is controlled with the loading property.

<agl-button label="Search" icon="pi pi-check" [loading]="loading()" (onClick)="load()" />

Disabled

When disabled is present, the element cannot be edited or focused.

<agl-button label="Submit" [disabled]="true" />

API

Generated from the committed corpus, which check:corpus holds to the built library.

ButtonLabel

directive[aglButtonLabel]
InputTypeDefaultDescription
ptButtonLabel
deprecated — use pButtonLabelPT instead.
any undefined Used to pass attributes to DOM elements inside the aglButtonLabel.
pButtonLabelPTany undefined Used to pass attributes to DOM elements inside the aglButtonLabel.
pButtonLabelUnstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

ButtonIcon

directive[aglButtonIcon]
InputTypeDefaultDescription
ptButtonIcon
deprecated — use pButtonIconPT instead.
any undefined Used to pass attributes to DOM elements inside the aglButtonIcon.
pButtonIconPTany undefined Used to pass attributes to DOM elements inside the aglButtonIcon.
pButtonUnstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

ButtonDirective

directive[aglButton]

Button directive is an extension to button component.

InputTypeDefaultDescription
ptButtonDirective
deprecated — use pButtonPT instead.
ButtonPassThrough undefined Used to pass attributes to DOM elements inside the Button component.
pButtonPTButtonPassThrough undefined Used to pass attributes to DOM elements inside the Button component.
pButtonUnstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
hostNameanynot documented
textbooleannot documentedAdd a textual class to the button without a background initially.
plainbooleannot documentedAdd a plain textual class to the button without a background initially.
raisedbooleannot documentedAdd a shadow to indicate elevation.
size'small' | 'large' | undefinednot documentedDefines the size of the button.
outlinedbooleannot documentedAdd a border class without a background initially.
roundedbooleannot documentedAdd a circular border radius to the button.
iconPosButtonIconPositionnot documentedPosition of the icon.
loadingIconstring | undefinednot documentedIcon to display in loading state.
fluid undefined Spans 100% width of the container when enabled.
label
deprecated — use aglButtonLabel directive instead.
string | undefinednot documentedText of the button.
icon
deprecated — use aglButtonIcon directive instead
stringnot documentedName of the icon.
loadingbooleannot documentedWhether the button is in loading state.
buttonProps
deprecated — assign props directly to the button element.
ButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the Button component.
severityButtonSeveritynot documentedDefines the style of the button.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.

Button

componentagl-button

Button is an extension to standard button element with icons and theming.

InputTypeDefaultDescription
hostNameanynot documented
typestringnot documentedType of the button.
badgestring | undefinednot documentedValue of the badge.
disabledboolean | undefinednot documentedWhen present, it specifies that the component should be disabled.
raisedbooleannot documentedAdd a shadow to indicate elevation.
roundedbooleannot documentedAdd a circular border radius to the button.
textbooleannot documentedAdd a textual class to the button without a background initially.
plainbooleannot documentedAdd a plain textual class to the button without a background initially.
outlinedbooleannot documentedAdd a border class without a background initially.
linkbooleannot documentedAdd a link style to the button.
tabindexnumber | undefinednot documentedAdd a tabindex to the button.
size'small' | 'large' | undefinednot documentedDefines the size of the button.
variant'outlined' | 'text' | undefinednot documentedSpecifies the variant of the component.
style{ [klass: string]: any } | null | undefinednot documentedInline style of the element.
styleClassstring | undefinednot documentedClass of the element.
badgeClass
deprecated — use badgeSeverity instead.
string | undefinednot documentedStyle class of the badge.
badgeSeverity'success' | 'info' | 'warn' | 'danger' | 'help' | 'primary' | 'secondary' | 'contrast' | null | undefined secondary Severity type of the badge.
ariaLabelstring | undefinednot documentedUsed to define a string that autocomplete attribute the current element.
autofocusboolean | undefinednot documentedWhen present, it specifies that the component should automatically get focus on load.
iconPosButtonIconPositionnot documentedPosition of the icon.
iconstring | undefinednot documentedName of the icon.
labelstring | undefinednot documentedText of the button.
loadingbooleannot documentedWhether the button is in loading state.
loadingIconstring | undefinednot documentedIcon to display in loading state.
severityButtonSeveritynot documentedDefines the style of the button.
buttonPropsButtonPropsnot documentedUsed to pass all properties of the ButtonProps to the Button component.
fluid undefined Spans 100% width of the container when enabled.
OutputTypeDescription
onClickEventEmitter<MouseEvent>Callback to execute when button is clicked. This event is intended to be used with the <agl-button> component. Using a regular <button> element, use (click).
onFocusEventEmitter<FocusEvent>Callback to execute when button is focused. This event is intended to be used with the <agl-button> component. Using a regular <button> element, use (focus).
onBlurEventEmitter<FocusEvent>Callback to execute when button loses focus. This event is intended to be used with the <agl-button> component. Using a regular <button> element, use (blur).
Template slotDescription
<ng-template #content>Custom content template.
<ng-template #loadingicon>Custom loading icon template.
<ng-template #icon>Custom icon template.

Inherited from BaseComponent

inherited
InputTypeDefaultDescription
dtObject | undefined undefined Defines scoped design tokens of the component.
unstyledboolean | undefined undefined Indicates whether the component should be rendered without styles.
ptPT | undefined undefined Used to pass attributes to DOM elements inside the component. TRUSTED INPUT ONLY. Whatever you put here is applied to the DOM as given: keys become attributes, and a key that names a DOM property is assigned to that property directly, with no sanitizer in between. That is what makes the API useful, and it means a value reaching it from a user, a database or a CMS can execute script. Treat it like markup you wrote yourself, not like data you received.
ptOptionsPassThroughOptions | undefined undefined Used to configure passthrough(pt) options of the component.