Angular SplitButton

Angular SplitButton

·

2 min read

Angular SplitButton groups a set of commands in an overlay with a default command.

Setup

Refer to PrimeNG setup documentation for download and installation steps for your environment.

Import

import {SplitButtonModule} from 'primeng/splitbutton';

Getting Started

SplitButton has a default command button and a collection of menuitems to be displayed in an overlay.

<p-splitButton label="Save" icon="pi pi-check" (onClick)="save()" [model]="items"></p-splitButton>

Animation Configuration

Transition of the open and hide animations can be customized using the showTransitionOptions and hideTransitionOptions properties, example below disables the animations altogether.

<p-splitButton [showTransitionOptions]="'0ms'" [hideTransitionOptions]="'0ms'" label="Save" icon="pi pi-check" (onClick)="save()" [model]="items"></p-splitButton>

SplitButton uses the common menumodel api to define its items, visit MenuModel API for details.

Theming

SplitButton supports various themes featuring Material, Bootstrap, Fluent as well as your own custom themes via the Designer tool.

Resources

Visit the PrimeNG SplitButton showcase for demos and documentation.