In this example, we’re using the mat-paginator-page-size-label directive to add a custom input element to the paginator. We’re also binding the input’s ngModel to a variable called pageSize, which we’ll use to update the page size when the user changes it.
Finally, we’re also setting the pageIndex of the paginator to 0 whenever the input loses focus, so that we always start on the first page when the page size changes.