Skip to content

AttributeError: module 'dash_bootstrap_components' has no attribute 'PaginationItem' #958

Closed Answered by tcbegley
Davidyang1989 asked this question in Q&A
Discussion options

You must be logged in to vote

Hey @Davidyang1989

I don't see PaginationItem listed anywhere in the migration guide or the docs?

See the examples here. You should create a Pagination component and then use the active_page prop in your callbacks to respond accordingly. If you want to use the pagination component to navigate then you would do something like the following

@app.callback(Output("page-content", "children"), Input("pagination", "active_page"))
def show_page_content(active_page):
    if active_page == 1:
        return page_1_content  # can save this as a global variable or generate on the fly
    elif active_page == 2:
        return page_2_content
    else:
        # page not found: display error
        return

Replies: 1 comment

Comment options

You must be logged in to vote
0 replies
Answer selected by tcbegley
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants