Skip to content

Latest commit

 

History

History
31 lines (20 loc) · 605 Bytes

File metadata and controls

31 lines (20 loc) · 605 Bytes

reflex-pagination

Use the pagination like this

# Snippet from reflex_pagination.py example app. 
    ...
    pagination(
        State.fruit,
        render_item=lambda item, idx: rx.text(f"{idx} {item}"),
    ),

Subclass it an override the rendering functions if you like.

class CustomPagination(Pagination):

    @override
    @classmethod
    def render(cls) -> rx.Component:
        return rx.vstack(cls.render_controls(), cls.render_list())


custom_pagination = CustomPagination.create

So it basically works exactly like rx.foreach, but paginates the output.