Passing page numbers via children is deprecated in SWAN v3.24
Always use the explicit pageNumber prop. The component uses this value to generate accessible announcements via SWAN's i18n system.
Passing page numbers via children is deprecated in SWAN v3.24
Always use the explicit pageNumber prop. The component uses this value to generate accessible announcements via SWAN's i18n system.
Pagination allows for navigation across a range of pages of related content and also indicates a user's position within that range. SWAN provides a standard set of controls, leaving it up to the particular page to implement the pagination logic behind them.
Use PaginationButton and PaginationStep with an href to navigate between pages or update the URL (e.g., routing or query param changes). These components render as anchor (<a>) tags by default
The preview has been updated.
When your pagination updates content dynamically within the same page, i.e., without a URL change or navigation, you should render each item as a <button> instead of an <a> tag.
To do this, omit the href prop and pass as="button" to each PaginationStep and PaginationButton.
The preview has been updated.
Use disabled onPaginationButton to indicate a boundary has been reached. Do not disable PaginationStep numbers.
The preview has been updated.
disabled on PaginationStep is deprecated in SWAN v3.24
Individual pages should not be disabled, as doing so prevents users from accessing them and leaves them uncertain about the reason for their unavailability. Please remove uses of this prop.
<a> or <button> tags. The React PaginationButton component will default to <a> tags. Use <a> tags if a click takes the user to a new page; use <button> tags if a click loads new content into the same page.disabled prop to the PaginationButton.<a> tags, change the Prev/Next button to a <span> tag and add class swan-pagination-button-disabled. If your Pagination uses <button> tags, disable the button as you normally would for a button, by adding the attribute disabled="disabled".<a> tags, which means they are links and need an href attribute. If your Pagination buttons aren't links, and instead perform in-page actions, they should be <button> tags, such as by using as="button" in the React API.aria-label and aria-describedby attributes (as show in the code examples above). Any aria-label values will need to be localized, since they will be presented to the user by screen readers and assistive devices.Use a consistent number of steps and ellipses in Pagination to maintain a uniform width.


<nav>.| prop | type | required | default | deprecation notes |
|---|---|---|---|---|
⚠️ Deprecated accessibleTextProvide the text that should be used for screen readers.
@deprecated This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. | stringnull | false | null | This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. |
<li>. Native HTML attributes and the ref go to its inner a (a button when disabled).| prop | type | required | default | deprecation notes |
|---|---|---|---|---|
disabledShould it be disabled or not
When true, always renders as a native `<button disabled>` regardless of the `as` prop. | booleannull | false | false | |
variantButton type | "next""previous"null | false | null | |
⚠️ Deprecated accessibleTextProvide the text that should be used for screen readers.
@deprecated This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. | stringnull | false | null | This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. |
<li>. Native HTML attributes and the ref go to its inner a (a button when disabled).| prop | type | required | default | deprecation notes |
|---|---|---|---|---|
activeShould it be active or not | booleannull | false | false | |
⚠️ Deprecated disabledShould it be disabled or not
When true, always renders as a native `<button disabled>` regardless of the `as` prop.
@deprecated This is deprecated without a replacement. Individual pages should not be disabled. | booleannull | false | false | This is deprecated without a replacement. Individual pages should not be disabled. |
⚠️ Deprecated accessibleTextProvide the text that should be used for screen readers.
@deprecated This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. | stringnull | false | null | This prop will be removed in favor of SWAN's i18n system. Please opt in to the i18n system for continued support. |
pageNumberThe page number this step represents | number | false | null |
| Component | Renders | Notes |
|---|---|---|
PaginationEllipses | <li> | Native HTML attributes and the ref go to its inner div. |
SWAN's Internationalization System allows SWAN components to render with fully translated and accessible text out-of-the-box. The following keys are provided to allow you to override the default translation.
| Default Text | Key |
|---|---|
Pagination | pagination.accessible-text |
Go to next page | pagination-button-next.accessible-text-for-icon |
Go to previous page | pagination-button-previous.accessible-text-for-icon |
Go to page {{pageNumber}} | pagination-step.accessible-text-for-button |