docs: improve sidebar items custom props docs (#8888)

This commit is contained in:
Sébastien Lorber 2023-04-13 11:24:27 +01:00 committed by GitHub
parent 35183d7d87
commit 14586895ae
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
13 changed files with 42 additions and 20 deletions

View file

@ -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
};
```