Skip to main content

Pagination

The Pagination component enables navigation between pages of content. It provides a simple interface for users to move between pages in a multi-page layout.


import dash
from dash import html, Input, Output, State
import yipit_dash_mui_components as dmc

dash._dash_renderer._set_react_version('18.2.0')

app = dash.Dash(__name__)

app.layout = html.Div([
dmc.Pagination(
id="pagination",
count=10,
color="primary",
showFirstButton=True,
showLastButton=True
),
html.Div(id="page-content")
])

@app.callback(
Output("page-content", "children"),
Input("pagination", "page")
)
def update_page(page_number):
if page_number:
return f"You are on page {page_number}"
return "Please select a page"

if __name__ == '__main__':
app.run_server(debug=True)


Props Table

NameTypeDefaultDescription
idstringundefinedThe ID used to identify this component
countnumber1Number of pages
pagenumber1The current page number
color"primary" | "secondary" | "standard""standard"The color of the pagination component
showFirstButtonbooleanfalseIf true, show the first-page button
showLastButtonbooleanfalseIf true, show the last-page button
sxSxPropsundefinedMUI system props for custom styling

For the full list of props, refer to the official MUI documentation, as this component is based on MUI:

MUI Pagination Documentation