Skip to content
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

Pagination - change number of visible page on screen #43513

Closed
Tamir198 opened this issue Aug 29, 2024 · 3 comments
Closed

Pagination - change number of visible page on screen #43513

Tamir198 opened this issue Aug 29, 2024 · 3 comments
Assignees
Labels
component: pagination This is the name of the generic UI component, not the React module! customization: dom Component's DOM customizability, e.g. slot support: question Community support but can be turned into an improvement

Comments

@Tamir198
Copy link

Tamir198 commented Aug 29, 2024

Summary

I want to have a pagination that will only display 3 pages on the screen like this :

< ... 3 2 1>
< 9 8 7 ...>
< ... 6 5 4 ...> 

Examples

I tried to have an example like this :

<Pagination siblingCount={0} boundaryCount={1} count={10}/>

This is what I see :

image
image
image

is it possible to have a pagination with only 3 pages visible?

Motivation

No response

Search keywords: pagination override

@Tamir198 Tamir198 added the status: waiting for maintainer These issues haven't been looked at yet by a maintainer label Aug 29, 2024
@Tamir198 Tamir198 changed the title Pagination - override the default view of number Pagination - change number of visible page on screen Aug 29, 2024
@zannager zannager added the component: pagination This is the name of the generic UI component, not the React module! label Aug 29, 2024
@siriwatknp
Copy link
Member

You can try to use renderItem with <PaginationItem />:

<Pagination siblingCount={0} boundaryCount={1} count={10} renderItem={item => {
  if (…condition that you don't want to show) {
    return null;
  }
  return <PaginationItem {...item} />
}} />

https://mui.com/material-ui/react-pagination/#custom-icons

@siriwatknp siriwatknp added support: question Community support but can be turned into an improvement customization: dom Component's DOM customizability, e.g. slot and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 30, 2024
Copy link

This issue has been closed. If you have a similar problem but not exactly the same, please open a new issue.
Now, if you have additional information related to this issue or things that could help future readers, feel free to leave a comment.

Note

@Tamir198 How did we do? Your experience with our support team matters to us. If you have a moment, please share your thoughts in this short Support Satisfaction survey.

@siriwatknp
Copy link
Member

Or using this:

<Pagination count={9} defaultPage={6} boundaryCount={0} />

See https://mui.com/material-ui/react-pagination/#pagination-ranges

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
component: pagination This is the name of the generic UI component, not the React module! customization: dom Component's DOM customizability, e.g. slot support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants