sidebar_label | sidebar_class_name |
---|---|
Sidebar Front Matter Tests |
dogfood_sidebar_class_name_test |
import Link from '@docusaurus/Link';
import {useCurrentSidebarCategory} from '@docusaurus/theme-common';
import DocCardList from '@theme/DocCardList';
<DocCardList />
---
## Items table
export const DocPropsList = ({category}) => {
const items = [category, ...category.items];
return (
<table>
<thead>
<tr>
<th>
<code>type</code>
</th>
<th>
<code>label</code>
</th>
<th>
<code>customProps</code>
</th>
<th>
<code>className</code>
</th>
</tr>
</thead>
<tbody>
{items.map((item, index) => (
<tr key={index}>
<td>{item.type}</td>
<td>
<Link to={item.href}>{item.label}</Link>
</td>
<td>{JSON.stringify(item.customProps)}</td>
<td>{JSON.stringify(item.className)}</td>
</tr>
))}
</tbody>
</table>
);
};
<DocPropsList category={useCurrentSidebarCategory()} />