Skip to content

Commit a1dff39

Browse files
committed
Document the new behavior parameter in the pagination component
1 parent 5b3be40 commit a1dff39

File tree

1 file changed

+11
-2
lines changed

1 file changed

+11
-2
lines changed

docs/javascript/components_pagination.md

Lines changed: 11 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,12 +23,21 @@ Defaults to `0`.
2323

2424
Number of available pages. Must be greater than `1` for the pagination to be displayed.
2525

26+
### `behavior`
27+
28+
Defines the behavior of the pagination. Defaults to `auto`.
29+
30+
| Value | Behavior |
31+
| -------- | -------- |
32+
| `auto` | If a `url` parameter has been passed, the behavior is automatically set to `link`, otherwise to `button`. |
33+
| `link` | The pagination creates static links using `<a>` tags. Requires the `url` parameter to be set. |
34+
| `button` | The pagination creates buttons that will fire the `switchPage` event when clicked. If you combine `behavior="button"` with a value for the `url` parameter, the pagination will create static links using `<a>` tags, but will still fire the `switchPage` event when a link is clicked. |
35+
2636
### `url`
2737

2838
Defaults to an empty string.
2939

30-
If defined, static pagination links are created based on the URL with the `pageNo` parameter appended to it.
31-
Otherwise only the `switchPage` event will be fired if a user clicks on a pagination link.
40+
Used to create static links using `<a>` tags with the `pageNo` parameter appended to it.
3241

3342
## Events
3443

0 commit comments

Comments
 (0)