mirror of
https://github.com/facebook/docusaurus.git
synced 2025-06-03 11:22:30 +02:00
docs: improve sidebar items custom props docs (#8888)
This commit is contained in:
parent
35183d7d87
commit
14586895ae
13 changed files with 42 additions and 20 deletions
|
@ -157,15 +157,18 @@ module.exports = {
|
|||
|
||||
## Passing custom props {#passing-custom-props}
|
||||
|
||||
To pass in custom props to a swizzled sidebar item, add the optional `customProps` object to any of the items:
|
||||
To pass in custom props to a sidebar item, add the optional `customProps` object to any of the items. This is useful to apply site customizations by swizzling React components rendering sidebar items.
|
||||
|
||||
```js
|
||||
{
|
||||
type: 'doc',
|
||||
id: 'doc1',
|
||||
// highlight-start
|
||||
customProps: {
|
||||
/* props */
|
||||
badges: ['new', 'green'],
|
||||
featured: true,
|
||||
},
|
||||
// highlight-end
|
||||
};
|
||||
```
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue