Skip to content

Commit

Permalink
Merge pull request #50 from HubSpot/ms-add-menu
Browse files Browse the repository at this point in the history
Add menu docs
  • Loading branch information
mshannon-hs authored Apr 18, 2024
2 parents bf45dad + a3060b9 commit 2e2ca96
Showing 1 changed file with 47 additions and 0 deletions.
47 changes: 47 additions & 0 deletions docs/reference/cms-components.md
Original file line number Diff line number Diff line change
Expand Up @@ -338,3 +338,50 @@ export const fields = [
},
];
```

### Menu

#### @hubspot/cms-components/Menu

The Menu field helper component inserts the HubL menu HTML into the DOM.

##### Props

###### fieldPath

type: `string`

The path of the Menu field to render

###### tag

The tag used as the wrapping element for the content.

default: `div`

###### Element attributes

This component passes through all valid attributes to the wrapper tag and applies them, such as `id`, `style`, etc.

##### Example Usage

```javascript
import { Menu } from '@hubspot/cms-components';

export function Component() {
return <Menu fieldPath="my_menu_field" />;
}

export const meta = {
label: `Menu Module`,
};

export const fields = [
{
type: 'menu',
default: 57978762829,
label: 'Menu',
name: 'my_menu_field',
},
];
```

0 comments on commit 2e2ca96

Please sign in to comment.