The main button runs the primary action. The chevron opens related actions.
Unlock it plus 108 pro blocks, widgets & layouts — $99 one-time. Lifetime updates, 14-day money-back guarantee.
Nothing yet
<ply-split-button label="Save" [items]="items" (action)="save()" (itemSelect)="run($event)"> </ply-split-button>
TypeScript
import { Component, signal } from '@angular/core';
// Install: npx ply-ui-cli add split-button
// Paths are relative to aliases.components (default: src/app/components)
import { SplitButtonComponent, SplitButtonItem } from './split-button/split-button.component';
@Component({
selector: 'app-split-button-example',
imports: [
SplitButtonComponent
],
template: `...`
})
export class SplitButtonExampleComponent {
readonly items: SplitButtonItem[] = [
{ label: 'Save draft', value: 'draft' },
{ label: 'Save a copy', value: 'copy' },
];
readonly last = signal('Nothing yet');
save(): void {
this.last.set('Saved');
}
run(item: SplitButtonItem): void {
this.last.set(item.label);
}
}Install
npx ply-ui-cli add split-button
npx ply-ui-cli add split-button
For AI agents
Copy a prompt with the registry name, CLI install, and import — or add the Ply MCP server.
npx -y ply-ui-mcp
Ply provides standalone components. Import the exact elements you want to use into your component.
// Install: npx ply-ui-cli add split-button
// Paths are relative to aliases.components (default: src/app/components)
import { SplitButtonComponent, SplitButtonItem } from './split-button/split-button.component';
@Component({
selector: 'app-your-component',
imports: [
SplitButtonComponent
],
template: `...`
})
export class YourComponent {} API for split-button — generated from JSDoc in the library source.
| API | Member | Type | Default | Description |
|---|---|---|---|---|
SplitButtonItem | label | string | — | — |
SplitButtonItem | value | string | — | — |
SplitButtonItem | disabled | boolean | — | — |
ply-split-button | class | string | '' | Extra host classes merged via `cn()`. |
ply-split-button | label | unknown | 'Save' | Label of the primary action. |
ply-split-button | items | SplitButtonItem[] | [] | Menu actions. |
ply-split-button | menuLabel | string | '' | Accessible name of the menu button. |
ply-split-button | (action) | void | — | Fires when the primary action is clicked. |
ply-split-button | (itemSelect) | SplitButtonItem | — | Fires when a menu item is chosen. |
Content