Pagers can be easily added to forms using the pager type. You can provide the following optional attributes:
- #element: The pager ID to use if you need to distinguish between multiple pagers on the screen; it defaults to 0
- #parameters: An associative array of query parameters to append to each link of the pager
- #quantity: The maximum number of links to display; it defaults to 9
- #tags: Text to use for the First, Previous, Next, and Last links
- #route_name: The name of the route to use for the URLs; it defaults to <none>, which uses the current route
Consider this example:
// Create dummy pager
pager_default_initialize(100, 10);
$form['pager'] = array(
'#type' => 'pager',
);

Pager type