CustomButtons component renders a list of customizable buttons.
app-custom-buttons
true
[CommonModule, FormsModule, FontAwesomeModule]
buttons - Array of button configurations. Each button configuration includes properties such as:
<app-custom-buttons [buttons]="buttonsArray"></app-custom-buttons> Copy
<app-custom-buttons [buttons]="buttonsArray"></app-custom-buttons>
const buttonsArray: CustomButton[] = [ { action: () => console.log('Button 1 clicked'), show: true, backgroundColor: 'blue', disabled: false, icon: faCoffee, iconStyle: { color: 'white' }, text: 'Button 1', textStyle: { color: 'white' }, customComponent: <CustomComponent />, injector: Injector.create({ providers: [{ provide: 'customProp', useValue: 'customValue' }] }), },]; Copy
const buttonsArray: CustomButton[] = [ { action: () => console.log('Button 1 clicked'), show: true, backgroundColor: 'blue', disabled: false, icon: faCoffee, iconStyle: { color: 'white' }, text: 'Button 1', textStyle: { color: 'white' }, customComponent: <CustomComponent />, injector: Injector.create({ providers: [{ provide: 'customProp', useValue: 'customValue' }] }), },];
CustomButtons
mergeStyles - Merges default styles with user-provided custom styles.
isCustomComponentConfig - Type guard to check if an object is of type CustomComponent.
CustomButtons component renders a list of customizable buttons.
Selector
app-custom-buttons
Standalone
true
Imports
[CommonModule, FormsModule, FontAwesomeModule]
Input
buttons - Array of button configurations. Each button configuration includes properties such as:
Example
Example
CustomButtons
Method
mergeStyles - Merges default styles with user-provided custom styles.
Method
isCustomComponentConfig - Type guard to check if an object is of type CustomComponent.