mirror of
https://github.com/facebook/docusaurus.git
synced 2025-08-04 01:09:20 +02:00
feat(v2): add custom props for consumption by swizzled sidebar (#3888)
This commit is contained in:
parent
0b05806593
commit
b11c24b752
6 changed files with 41 additions and 11 deletions
|
@ -288,6 +288,20 @@ module.exports = {
|
|||
};
|
||||
```
|
||||
|
||||
#### Custom Props
|
||||
|
||||
If you would like to pass in custom props to a swizzled sidebar item, an optional object called `customProps` can be added to any of the items:
|
||||
|
||||
```js
|
||||
{
|
||||
type: 'doc';
|
||||
id: 'doc1';
|
||||
customProps: {
|
||||
/* props */
|
||||
}
|
||||
}
|
||||
```
|
||||
|
||||
#### Collapsible categories
|
||||
|
||||
For sites with a sizable amount of content, we support the option to expand/collapse a category to toggle the display of its contents. Categories are collapsible by default. If you want them to be always expanded, set `themeConfig.sidebarCollapsible` to `false`:
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue