Pagination
The pagination widget uses the <devsite-pagination>
custom element to display
paginated content or toggle the amount of content shown.
General usage
The following example uses the <devsite-pagination>
custom element to specify
a container
element that paginates four <div>
elements per page.
Div 1
Div 2
Div 3
Div 4
Div 5
Div 6
Div 7
Div 8
Div 9
Div 10
Div 11
Div 12
Div 13
Div 14
Div 15
Multiple HTML elements
The following example uses the <devsite-pagination>
custom element to specify
a container
element that paginates both <p>
and <div>
elements in the same
container.
This is paragraph 1.
This is paragraph 2.
This is paragraph 3.
This is paragraph 4.
This is paragraph 5.
This is paragraph 6.
This is div 1.
This is div 2.
This is div 3.
This is div 4.
This is div 5.
This is div 6.
The following example uses the <devsite-pagination>
custom element to specify
a container
element that loads eight initial <div>
elements and can be
toggled to display More.
Div 1
Div 2
Div 3
Div 4
Div 5
Div 6
Div 7
Div 8
Div 9
Div 10
Div 11
Div 12
Div 13
Div 14
Div 15
Start-expand
The following example uses the <devsite-pagination>
custom element to specify
a container
element with a start-expanded
attribute that loads all <div>
elements and can be toggled to display Less.
Div 1
Div 2
Div 3
Div 4
Div 5
Div 6
Div 7
Div 8
Div 9
Div 10
Div 11
Div 12
Div 13
Div 14
Div 15
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2022-04-01 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2022-04-01 UTC."],[],[]]