File

src/tabs/tab-skeleton.component.ts

Description

Skeleton component for tabs

Metadata

Index

Properties
Inputs
HostBindings
Accessors

Inputs

numOftabs
Type : number

Set number of skeleton tabs to render, default is 5

HostBindings

class.cds--skeleton
Type : boolean
Default value : true

Set to true to put tabs in a loading state.

class.cds--tabs
Type : boolean
Default value : true

Properties

numOfSkeletonTabs
Default value : new Array(5)
skeleton
Default value : true
Decorators :
@HostBinding('class.cds--skeleton')

Set to true to put tabs in a loading state.

tabs
Default value : true
Decorators :
@HostBinding('class.cds--tabs')

Accessors

numOftabs
setnumOftabs(num: number)

Set number of skeleton tabs to render, default is 5

Parameters :
Name Type Optional
num number No
Returns : void
import {
	Component,
	HostBinding,
	Input
} from "@angular/core";

/**
 * Skeleton component for tabs
 */
@Component({
	selector: "cds-tabs-skeleton, ibm-tabs-skeleton",
	template: `
		<ul class="cds--tabs__nav">
			<li
				*ngFor="let i of numOfSkeletonTabs"
				class="cds--tabs__nav-item">
				<div class="cds--tabs__nav-link">
					<span></span>
				</div>
			</li>
		</ul>
	`
})
export class TabSkeleton {
	/**
	 * Set number of skeleton tabs to render, default is 5
	 */
	@Input() set numOftabs(num: number) {
		this.numOfSkeletonTabs = new Array(num);
	}

	/**
	 * Set to `true` to put tabs in a loading state.
	 */
	@HostBinding("class.cds--skeleton") skeleton = true;
	@HostBinding("class.cds--tabs") tabs = true;
	numOfSkeletonTabs = new Array(5);
}
Legend
Html element
Component
Html element with directive

results matching ""

    No results matching ""