0.7.1 • Published 3 months ago
@cypress-design/react-docmenu v0.7.1
DocMenu
Install
npm install @cypress-design/react-docmenu
or with yarn
yarn add @cypress-design/react-docmenu
Usage
import DocMenu from '@cypress-design/react-docmenu'
Default usage
export default () => (
<DocMenu
activePath="#group-item-3"
items={[
{
label: 'Get Started',
href: '#get-started',
},
{
label: 'Overview',
items: [
{
label: 'Overview Item 1',
href: '#overview-item-1',
},
{
label: 'Overview Item 2',
href: '#overview-item-2',
},
],
},
{
label: 'Getting Started',
items: [
{
label: 'Item 1',
href: '#item-1',
},
{
label: 'Group',
items: [
{
label: 'Item 1',
href: '#group-item-1',
},
{
label: 'Item 2',
href: '#group-item-2',
},
{
label: 'Item 3',
href: '#group-item-3',
},
{
label: 'Item 4',
href: '#group-item-4',
},
],
},
{
label: 'Item 5',
href: '#',
},
],
},
]}
/>
)
With a custom link
const CustomLink = ({ href, children, className }) => {
return (
<a
href={href}
className={className}
onClick={(evt) => {
console.log('The link was clicked.', { target: evt.target })
}}
>
{children} 🔗
</a>
)
}
export default () => (
<DocMenu
LinkComponent={CustomLink}
items={[
{
label: 'Install',
href: '#with-a-custom-link',
},
]}
/>
)
0.7.1
3 months ago
0.7.0
3 months ago
0.6.0
3 months ago
0.5.4
4 months ago
0.5.3
4 months ago
0.5.2
5 months ago
0.5.0
5 months ago
0.5.1
5 months ago
0.4.3
5 months ago
0.4.2
5 months ago
0.4.1
5 months ago
0.4.0
5 months ago
0.3.0
10 months ago
0.3.1
9 months ago
0.2.1
1 year ago
0.2.0
1 year ago
0.2.3
12 months ago
0.2.2
1 year ago
0.1.0
1 year ago