Props Reference
Common Props
Prop | Description |
---|---|
current number (required) | The current active page. Indexed from 1 |
total number (required) | The total number of pages |
onPageChange (newPage: number) => void (required) | A callback handler which is called when the user clicks a new page. The Note that the active page will not change unless the |
maxWidth number (optional) | The maximum width (in pixels) of the pagination component. Use this prop if you want to override the automatic sizing. Note the width may be exceeded if it's not possible a component to the specified width |
ClassName Props
See Overriding default classNames for more information
Prop | Description |
---|---|
className string (optional) | Class name for the top level <ul> container Defaults to |
extraClassName string (optional) | Useful when using Bootstrap styles, extra classNames to be added to the top level <ul> container. Use this prop to override the default justify value - for example to align elements to the start of the page use: Defaults to |
pageItemClassName string (optional) | Class name for all the <li> elements Defaults to |
pageLinkClassName string (optional) | Class name for <a> or <span> child elements within an <li> element:
Defaults to |
activeItemClassName string (optional) | Appended to <li> class name for the active element:
Defaults to |
disabledItemClassName string (optional) | Appended to <li> class name for non-clickable elements (disabled nav buttons and the break/ellipsis):
Defaults to |
string (optional) | Appended to <li> class name for nav items ( Setting to 'my-nav' would give html similar to:
By default will not be output |
previousClassName string (optional) | Appended to <li> class name for the previous button ( Setting to 'my-previous-button' would give html similar to:
Overrides |
nextClassName string (optional) | Appended to <li> class name for the next button ( Setting to 'my-next-button' would give html similar to:
Overrides |
Label Props
Prop | Description |
---|---|
previousLabel string | ReactNode (optional) | The label for the previous button, defaults to See the FAQ for further information on using React components for this prop |
nextLabel string | ReactNode (optional) | The label for the next button, defaults to See the FAQ for further information on using React components for this prop |
ariaPreviousLabel string (optional) | The accessibility ARIA label for the previous button, defaults to |
ariaNextLabel string (optional) | The accessibility ARIA label for the next button, defaults to |
ariaCurrentAttr boolean (optional) | Set to false to prevent output of See MDN's article on aria-current for further details |
Misc Props
Prop | Description |
---|---|
boolean (optional) | When set to |
narrowBehaviour NarrowBehaviour (optional) | Specify that nav buttons («/») and/or the ellipsis (…) can be dropped for very narrow widths (useful if the component is used in narrow widths with high page numbers) Valid behaviours should be imported from Valid NarrowBehaviours:
The default behaviour is to not drop any elements (this may change in a future major release) Using Multiple NarrowBehaviours Multiple NarrowBehaviours can be combined using the The behaviours will be applied in order so in this example, |
linkHref 'hash' | 'omit' | (page: number) => string (optional) | Set Set The default behaviour is to include |
labelBehaviour LabelBehaviour (optional) | for v1 compatibility V1 of react-reponsive-pagination used visually hidden span tags for screen reader labels (the current version uses only aria attributes). This prop can be used to re-enable the V1 behaviour (if preferred): By default 'sr-only' is used as the class for the visually hidden spans. To override this, pass The accessibility label for the active page defaults to (the active label can be turned off by passing a value of '') For reference, here's an example of a visually hidden css style: |