Open steve-nay-sage opened 3 years ago
Actually ToC already has a prop for controlling what is shown on initial render - https://github.com/stoplightio/elements/blob/main/packages/elements-core/src/components/MosaicTableOfContents/TableOfContents.tsx#L29 - it's called maxDepthOpenByDefault
- it just has to be utilised in API and StoplightProject components.
User story.
As a technical writer for a large API that is actually comprised of many APIs, I'd like to see nav items collapsed when Elements loads instead of expanded, so that the table of contents is more scannable and not so overwhelming
Describe the solution you'd like
A nav today might look like this:
As you can see, you can't see the APIs that are farther down in the nav. With this optional setting changed to "collapsed" the nav would look like this:
The API that I work with has many more groups and APIs than are shown here, so the problem with everything expanded by default is much worse.
There could be two configuration settings, one that controls whether nav items are expanded/collapsed by default and the other for nav groups.