SplitButton groups a collection of menu items in an overlay with a default command button. This button uses a common menu model API to define its items. Hence, the split button is a combination of button and menu components. A basic example of SplitButton component with defined label text would be written as follows:
<p-splitButton label="Create" (onClick)="create()" [model]="items">
</p-splitButton>
The label is applied only for the default command button. The following screenshot shows a snapshot result of the split button example:
The split button component supports one event callback named onClick, which will be invoked on the click of the default button element.
PrimeNG 4.1 provided appendTo the option which provides customization over where the overlay would be appended.