packages/components/eui-chip-button/eui-chip-button.component.ts
Chip button component that provides clickable chip-styled buttons for triggering actions. Similar to eui-chip but designed specifically for button interactions rather than display or removal. Supports color variants, sizes, and filled/outline styles for various use cases. Emits buttonClick event when clicked, making it ideal for filters, toggles, and action triggers.
<eui-chip-button (buttonClick)="onChipClick($event)">
Click me
</eui-chip-button><eui-chip-button euiPrimary [isFilled]="true">
Primary
</eui-chip-button>
<eui-chip-button euiSuccess>
Success
</eui-chip-button><eui-chip-button
id="filter-active"
[isFilled]="isActive"
(buttonClick)="toggleFilter($event)">
Active
</eui-chip-button><eui-chip-button
euiTooltip="Click to apply filter"
tooltipMessage="Filter by category">
Category
</eui-chip-button><eui-chip-button euiSizeS>Small</eui-chip-button>
<eui-chip-button>Default</eui-chip-button>onChipClick(id: string | number): void {
console.log('Chip button clicked:', id);
}
toggleFilter(id: string | number): void {
this.isActive = !this.isActive;
}| changeDetection | ChangeDetectionStrategy.OnPush |
| HostDirectives |
BaseStatesDirective
Inputs : euiPrimary euiSecondary euiSuccess euiInfo euiWarning euiDanger euiVariant euiSizeS euiSizeVariant euiOutline euiDisabled
|
| selector | eui-chip-button, span[euiChipButton], li[euiChipButton] |
| imports |
EUI_ICON
EUI_ICON_BUTTON
|
| templateUrl | ./eui-chip-button.component.html |
| styleUrl | ./eui-chip-button.scss |
Properties |
Methods |
Inputs |
Outputs |
HostBindings |
Accessors |
| e2eAttr |
Type : string
|
Default value : 'eui-chip'
|
|
Sets the |
| euiInternalId |
Type : string
|
Default value : null
|
|
Sets the euiInternalId of the chip. |
| id |
Type : string | number
|
|
Sets the id of the chip. |
| isFilled |
Type : boolean
|
Default value : false
|
|
Wether the chip is filled with color. |
| tooltipMessage |
Type : string
|
|
Sets the label of the tooltip to diaply on hover. |
| buttonClick |
Type : EventEmitter
|
| class |
Type : string
|
|
Computes and returns the CSS classes for the component based on its current state. |
| onClick |
onClick()
|
|
Returns :
void
|
| baseStatesDirective |
Type : unknown
|
Default value : inject(BaseStatesDirective)
|
| cssClasses |
getcssClasses()
|
|
Computes and returns the CSS classes for the component based on its current state.
Returns :
string
|