Skip to content

Commit 12f259d

Browse files
committed
docs(README): Document collapseAtCount.
1 parent b3e3dcb commit 12f259d

File tree

1 file changed

+13
-1
lines changed

1 file changed

+13
-1
lines changed

README.md

+13-1
Original file line numberDiff line numberDiff line change
@@ -168,6 +168,18 @@ inst.toggleOverflowNav();
168168

169169
## Options
170170

171+
### `collapseAtCount`
172+
173+
If you'd like to collapse into the overflow when the primary navigation becomes depleted, you can do with the `collapseAtCount` option:
174+
175+
```javascript
176+
priorityPlus(document.querySelector('.js-p-target'), {
177+
collapseAtCount: 2,
178+
});
179+
```
180+
181+
The above will move all menu items into the overflow if only two can 'fit' into the primary. This is essentially a way to avoid orphan nav items.
182+
171183
### Classes
172184
If you'd like to override the default classes, you can pass in a `classNames` object like so:
173185

@@ -271,4 +283,4 @@ If your menu is part of an auto-sized flex-child, it will probably need a positi
271283
.site-header__nav {
272284
flex-grow: 1;
273285
}
274-
```
286+
```

0 commit comments

Comments
 (0)