coreui-angular-ex-dev
Version:
CoreUI Components Library for Angular
50 lines (42 loc) • 1.13 kB
text/typescript
import { Component, HostBinding, Input } from '@angular/core';
import { Colors } from '../coreui.types';
export class SpinnerComponent {
/**
* Sets the color context of the component to one of CoreUI’s themed colors.
* @type Colors
*/
color?: Colors;
/**
* Label for accessibility.
* @type string
* @default 'Loading...'
*/
label: string = "Loading...";
/**
* Size the component small.
* @type string
* @values 'sm'
*/
size?: 'sm';
/**
* Set the button variant to an outlined button or a ghost button.
* @values 'border' | 'grow'
* @default 'border'
*/
variant?: 'border' | 'grow' = 'border';
role = 'status';
get hostClasses(): any {
return {
[`spinner-${this.variant}`]: true,
[`text-${this.color}`]: !!this.color,
[`spinner-${this.variant}-${this.size}`]: !!this.size
};
}
}