-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
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
[docs][material-ui][Pagination] Clarify pagination page
prop API
#42220
Conversation
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
Netlify deploy previewhttps://deploy-preview-42220--material-ui.netlify.app/ Bundle size report |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mandar-Pandya Thanks for the pull request. I agree that the information should be included in the API prop description, as it feels missing. We do have a note about this in a section here:
Note that the Pagination page prop starts at 1 to match the requirement of including the value in the URL, while the TablePagination page prop starts at 0 to match the requirement of zero-based JavaScript arrays that come with rendering a lot of tabular data.
However, it would be helpful to also mention it in the API docs.
I suggest adding the following description:
The current page. The page starts at
1
unlikeTablePagination
which starts at0
.
Additionally, you'll need to update this in the usePagination
type definition file here and then run the following commands:
pnpm proptypes
pnpm docs:api
This will update the PropTypes and the docs, and fix the CI. Please refer to the Contributing guide.
page
prop API
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@Mandar-Pandya Thanks for the improvement! I made a slight tweak to the sentence.
…42220) Signed-off-by: Mandar-Pandya <112475099+Mandar-Pandya@users.noreply.github.com> Co-authored-by: ZeeshanTamboli <zeeshan.tamboli@gmail.com>
Description
The current documentation for pagination api https://mui.com/material-ui/api/pagination/ is showing a bit of unclear description for the page attribute as it is not mentioned that is it a zero based index or not.
This is confusing because a similar api https://mui.com/material-ui/api/table-pagination/ where the same attribute is there and it is mentioned that it is a zero-based index and it might be confusing to not mentioned the same thing for pagination api i.e. it is not a zero based index.
Preview: https://deploy-preview-42220--material-ui.netlify.app/material-ui/api/pagination/#pagination-prop-page