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

Open
Tamir198 opened this issue Aug 29, 2024 · 1 comment
Open

Pagination - change number of visible page on screen #43513

Tamir198 opened this issue Aug 29, 2024 · 1 comment
Assignees
Labels
component: pagination This is the name of the generic UI component, not the React module! customization: slot Component's slot customizability 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: slot Component's slot customizability and removed status: waiting for maintainer These issues haven't been looked at yet by a maintainer labels Aug 30, 2024
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: slot Component's slot customizability support: question Community support but can be turned into an improvement
Projects
None yet
Development

No branches or pull requests

3 participants