chrome:shell.skip

generated:catalog.entry.button-group.title

generated:catalog.entry.button-group.description

@xngui/components/button-group
@xngui/components/button-group

chrome:demo.section

chrome:demo.preview

demo-preview:button-group.insert-link
demo-preview:hints.category.navigation:
Tab
demo-preview:hints.category.focus:
Focus
demo-preview:hints.category.shortcuts:
Enter / Space
demo-preview:projection.slots-label:
ng-content
import { Component } from '@angular/core';
import { XActionSeparator } from '@xngui/components/action-separator';
import { XButton, XButtonLink } from '@xngui/components/button';
import { XButtonGroup } from '@xngui/components/button-group';
import { XKbd } from '@xngui/components/kbd';
import { XIcon } from '@xngui/icons';
 
@Component({
selector: 'app-example',
imports: [XActionSeparator, XButton, XButtonLink, XButtonGroup, XKbd, XIcon],
templateUrl: './button-group.component.html',
})
export class ExampleComponent {
protected onButtonClicked(label: string, event: { originalEvent: MouseEvent }): void {
const input = event.originalEvent.detail === 0 ? 'keyboard' : 'pointer';
// handle activation
}
protected onLinkClicked(label: string, event: MouseEvent): void {
event.preventDefault();
const input = event.detail === 0 ? 'keyboard' : 'pointer';
// handle link activation
}
}

chrome:demo.events.title

chrome:demo.events.empty

chrome:demo.api.title

x-button-group

chrome:demo.api.col.property
chrome:demo.api.col.type
chrome:demo.api.col.default
chrome:demo.api.col.description
orientation
XOrientation
'horizontal'
Join axis for child buttons.
size
XSize
—
Visual size tier — cascades to child buttons when unset locally.
density
XDensity
—
Spacing offsets — cascades to child buttons when unset locally.
variant
XVariant
—
Color role — cascades to child buttons; falls back to XConfigService when unset.
appearance
XAppearance
—
Surface treatment — cascades to child buttons; falls back to XConfigService when unset.
disabled
boolean
—
Prevents interaction — cascades to child buttons when unset locally.
stretch
boolean
false
When true, segments share the group size evenly.
ariaLabel
string
—
Accessible name — required when the grouped purpose is not visible.