-
-
Notifications
You must be signed in to change notification settings - Fork 296
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Improve API clarity for the PaginationRoot
component
#1043
Comments
Could you provide more context on this bug? Thanks! |
@epr3 Oh, sorry. My bad. I just thought that it means the total number of pages.. Maybe setting default value for Wait, why do we even need to specify the page size? I think this isn't necessary information for pagination. I tool a look at how other ui libraries do pagination, and in most cases they don't specify page size in props, only total number of pages. For example: https://mui.com/material-ui/react-pagination/ What do you think? |
I think that I guess we could set |
@zernonia Yeah, I get it. But still, the API feels a bit misleading. This code doesn't tell me that I will actually get 10 pages, instead of 100. I think that API should teach me how to use it, not the docs. <PaginationRoot
:total="100"
:sibling-count="1"
show-edges
:default-page="2"
>
...
</PaginationRoot> I would at least add the <PaginationRoot
:total="100"
:items-per-page="10"
:sibling-count="1"
show-edges
:default-page="2"
>
...
</PaginationRoot> If we dig even more, the number of items on a page is not really necessary to render pagination component. It is only used in the So why making API more complex if it doesn't need it? My ideal variant would be to separate knowledge about items from pagination component by removing <PaginationRoot
:total-pages="100"
:sibling-count="1"
show-edges
:default-page="2"
>
...
</PaginationRoot> like yeah, it's just my idea on how to improve it. I will close the issue if you not interested in this |
@MellKam Solid reason! 👍🏻 However as you can see the This sounds like something we can change in |
total
props invalid behaviourPaginationRoot
component
PaginationRoot
componentPaginationRoot
component
@zernonia I would rather just make |
Released in |
Link to minimal reproduction
https://www.radix-vue.com/components/pagination#pagination
Describe the bug
When you pass
100
to thetotal
props, it shows a maximum of 10 items. When you make1000
, it shows a maximum of 100. Essentially, it is divisible by 10, but it shouldn't be that way. You can check the code example on the website where total is set to 100, but it shows only 10 items.The text was updated successfully, but these errors were encountered: