Menu
Menus let users choose from a list of destinations or actions.
import { Menu, MenuTrigger, MenuContent, MenuItem, MenuItemGroup, MenuGroupLabel, MenuSeparator,} from '@cerberus/react'
Usage
NextJS Usage
To create a nav menu with NextJS, you should use the Link
component from next/link
combined with the asChild
prop.
Grouped Menu
You can group menu items by using the MenuItemGroup
component.
Positions
The Menu
component accepts a positioning
prop to determine where the menu will be positioned relative to the trigger. See available positions.
Customizing
You can customize every Menu component by passing in your own styles.
API
Menu
export interface MenuProps { positioning?: { placement: 'left' | 'right' | 'top' | 'bottom' }}
Name | Default | Description |
---|---|---|
positioning | null | Used to position the menu content. |
MenuTrigger
export interface MenuTriggerProps { children: React.ReactNode}
Name | Default | Description |
---|---|---|
children | null | The trigger element. |
MenuItem
export interface MenuItemProps { children: React.ReactNode value: string asChild?: boolean}
Name | Default | Description |
---|---|---|
children | null | The content of the menu item. |
value | null | The value of the menu item used for selection. |
asChild | false | Used to render the children as a child component. |
import { Menu, MenuTrigger, MenuContent, MenuItem, MenuItemGroup, MenuGroupLabel, MenuSeparator,} from '@cerberus/react'
Usage
NextJS Usage
To create a nav menu with NextJS, you should use the Link
component from next/link
combined with the asChild
prop.
Grouped Menu
You can group menu items by using the MenuItemGroup
component.
Positions
The Menu
component accepts a positioning
prop to determine where the menu will be positioned relative to the trigger. See available positions.
Customizing
You can customize every Menu component by passing in your own styles.
API
Menu
export interface MenuProps { positioning?: { placement: 'left' | 'right' | 'top' | 'bottom' }}
Name | Default | Description |
---|---|---|
positioning | null | Used to position the menu content. |
MenuTrigger
export interface MenuTriggerProps { children: React.ReactNode}
Name | Default | Description |
---|---|---|
children | null | The trigger element. |
MenuItem
export interface MenuItemProps { children: React.ReactNode value: string asChild?: boolean}
Name | Default | Description |
---|---|---|
children | null | The content of the menu item. |
value | null | The value of the menu item used for selection. |
asChild | false | Used to render the children as a child component. |
import { Menu, MenuTrigger, MenuContent, MenuItem, MenuItemGroup, MenuGroupLabel, MenuSeparator,} from '@cerberus/react'
Usage
NextJS Usage
To create a nav menu with NextJS, you should use the Link
component from next/link
combined with the asChild
prop.
Grouped Menu
You can group menu items by using the MenuItemGroup
component.
Positions
The Menu
component accepts a positioning
prop to determine where the menu will be positioned relative to the trigger. See available positions.
Customizing
You can customize every Menu component by passing in your own styles.
API
Menu
export interface MenuProps { positioning?: { placement: 'left' | 'right' | 'top' | 'bottom' }}
Name | Default | Description |
---|---|---|
positioning | null | Used to position the menu content. |
MenuTrigger
export interface MenuTriggerProps { children: React.ReactNode}
Name | Default | Description |
---|---|---|
children | null | The trigger element. |
MenuItem
export interface MenuItemProps { children: React.ReactNode value: string asChild?: boolean}
Name | Default | Description |
---|---|---|
children | null | The content of the menu item. |
value | null | The value of the menu item used for selection. |
asChild | false | Used to render the children as a child component. |
import { Menu, MenuTrigger, MenuContent, MenuItem, MenuItemGroup, MenuGroupLabel, MenuSeparator,} from '@cerberus/react'
Usage
NextJS Usage
To create a nav menu with NextJS, you should use the Link
component from next/link
combined with the asChild
prop.
Grouped Menu
You can group menu items by using the MenuItemGroup
component.
Positions
The Menu
component accepts a positioning
prop to determine where the menu will be positioned relative to the trigger. See available positions.
Customizing
You can customize every Menu component by passing in your own styles.
API
Menu
export interface MenuProps { positioning?: { placement: 'left' | 'right' | 'top' | 'bottom' }}
Name | Default | Description |
---|---|---|
positioning | null | Used to position the menu content. |
MenuTrigger
export interface MenuTriggerProps { children: React.ReactNode}
Name | Default | Description |
---|---|---|
children | null | The trigger element. |
MenuItem
export interface MenuItemProps { children: React.ReactNode value: string asChild?: boolean}
Name | Default | Description |
---|---|---|
children | null | The content of the menu item. |
value | null | The value of the menu item used for selection. |
asChild | false | Used to render the children as a child component. |