packages/components/layout/eui-toolbar/toolbar-selector/toolbar-selector.component.ts
Toolbar selector component providing a clickable button with icon and label for triggering selection actions. Typically used for context switching, workspace selection, or opening dropdown menus in the toolbar. Integrates with EuiAppShellService for responsive behavior and theme coordination. Supports disabled state and emits click events for parent components to handle selection logic.
Example :<eui-app>
<eui-app-toolbar>
<eui-toolbar>
<eui-toolbar-selector
label="Select Workspace"
iconSvgName="chevron-down:outline"
[euiDisabled]="false"
(selectorClick)="onSelectorClick()">
</eui-toolbar-selector>
</eui-toolbar>
</eui-app-toolbar>
</eui-app>onSelectorClick(): void {
// Open dropdown or handle selection
console.log('Selector clicked');
}| changeDetection | ChangeDetectionStrategy.OnPush |
| encapsulation | ViewEncapsulation.None |
| selector | eui-toolbar-selector |
| imports |
AsyncPipe
EUI_BUTTON
EUI_ICON
EUI_ICON_BUTTON
|
| templateUrl | ./toolbar-selector.component.html |
| styleUrl | ./toolbar-selector.component.scss |
Properties |
Methods |
Inputs |
Outputs |
HostBindings |
| euiDisabled |
Type : boolean
|
Default value : false
|
|
Disables the selector button preventing user interaction. When true, button is visually disabled and click events are not emitted. |
| iconSvgName |
Type : string
|
|
SVG icon name displayed on the selector button. Follows EUI icon naming convention (e.g., 'chevron-down:outline'). Optional. |
| label |
Type : string
|
|
Text label displayed on the selector button. Provides context for what the selector controls or represents. Optional. |
| class |
Type : string
|
Default value : 'eui-toolbar-selector'
|
| onClick |
onClick()
|
|
Returns :
void
|
| class |
Type : string
|
Default value : 'eui-toolbar-selector'
|
Decorators :
@HostBinding()
|