charmbracelet / bubbles

TUI components for Bubble Tea 🫧
MIT License
5.24k stars 247 forks source link

feat: Introduce paginator options #537

Open nervo opened 2 months ago

nervo commented 2 months ago

Introduce paginator options, to ease instanciation.

p := paginator.New(
    paginator.WithPerPage(42),
    paginator.WithTotalPages(42),
)

Only these two options has been added, but other could be easily added now that the foundations has been laid :)

Note: to be honnest, i don't know if you prefer such integration, or the "chain" one like:

p := paginator.New().WithPerPage(42).WithTotalPages(42)

I see bof of them in current charmbracelet ecosystem, just tell me :)