src/button/button-set.component.ts
Get started with importing the module:
Example :import { ButtonModule } from 'carbon-components-angular';| selector | cds-button-set, ibm-button-set |
| template | |
Properties |
Inputs |
HostBindings |
Accessors |
| fluid | |
Type : boolean
|
|
Default value : false
|
|
|
Defined in src/button/button-set.component.ts:33
|
|
|
When |
|
| stacked | |
Type : boolean
|
|
Default value : false
|
|
|
Defined in src/button/button-set.component.ts:38
|
|
|
When |
|
| class.cds--btn-set |
Type : boolean
|
Default value : true
|
|
Defined in src/button/button-set.component.ts:28
|
| class.cds--btn-set--fluid |
Type : boolean
|
|
Defined in src/button/button-set.component.ts:41
|
| class.cds--btn-set--stacked |
Type : boolean
|
|
Defined in src/button/button-set.component.ts:46
|
| buttonSetClass |
Default value : true
|
Decorators :
@HostBinding('class.cds--btn-set')
|
|
Defined in src/button/button-set.component.ts:28
|
| fluidClass |
getfluidClass()
|
|
Defined in src/button/button-set.component.ts:41
|
| stackedClass |
getstackedClass()
|
|
Defined in src/button/button-set.component.ts:46
|
import { Component, HostBinding, Input } from "@angular/core";
/**
* Get started with importing the module:
*
* ```typescript
* import { ButtonModule } from 'carbon-components-angular';
* ```
*
* [See demo](../../?path=/story/components-button-button-set--basic)
*/
@Component({
selector: "cds-button-set, ibm-button-set",
template: `
<div *ngIf="fluid" class="cds--btn-set__fluid-inner cds--btn-set__fluid-inner--auto-stack">
<ng-container *ngTemplateOutlet="content"></ng-container>
</div>
<ng-container *ngIf="!fluid">
<ng-container *ngTemplateOutlet="content"></ng-container>
</ng-container>
<ng-template #content>
<ng-content></ng-content>
</ng-template>
`
})
export class ButtonSet {
@HostBinding("class.cds--btn-set") buttonSetClass = true;
/**
* When `true`, buttons grow to fill the container width (fluid button set).
*/
@Input() fluid = false;
/**
* When `true`, stacks buttons vertically. Use with non-fluid layouts, otherwise `fluid` will override style
*/
@Input() stacked = false;
@HostBinding("class.cds--btn-set--fluid")
get fluidClass(): boolean {
return this.fluid;
}
@HostBinding("class.cds--btn-set--stacked")
get stackedClass(): boolean {
return this.stacked;
}
}