Tailwind CSS Menu - Props



Menu Props

The following props are available for menu component. These are the custom props that come with we've added for the menu component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
openbooleanMakes the menu open, when menu is controlledundefined
handlerfunctionChange open state for controlled menuundefined
placementPlacementChange menu placementbottom
offsetOffsetChange menu offset from it's handler5
dismissDismissChange dismiss listeners when clicking outsideundefined
animateAnimateChange menu animationundefined
lockScrollbooleanLock page scrolling when menu is openedfalse
childrennodeAdd content for menuNo default value it's a required prop.


For TypeScript Only

import type { MenuProps } from "@material-tailwind/react";

Menu Handler Props

The following props are available for menu handler component. These are the custom props that come with we've added for the menu handler component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
childrennodeAdd content for menu handlerNo default value it's a required prop.


For TypeScript Only

import type { MenuHandlerProps } from "@material-tailwind/react";

Menu List Props

The following props are available for menu list component. These are the custom props that come with we've added for the menu list component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
classNamestringAdd custom className for menu list''
childrennodeAdd content for menu listNo default value it's a required prop.


For TypeScript Only

import type { MenuListProps } from "@material-tailwind/react";

Menu Item Props

The following props are available for menu item component. These are the custom props that come with we've added for the menu item component and you can use all the other native props as well.

AttributeTypeDescriptionDefault
disabledbooleanDisable menu itemfalse
classNamestringAdd custom className for menu item''
childrennodeAdd content for menu itemNo default value it's a required prop.


For TypeScript Only

import type { MenuItemProps } from "@material-tailwind/react";

Types - Placement

type placement =
  | "top"
  | "top-start"
  | "top-end"
  | "right"
  | "right-start"
  | "right-end"
  | "bottom"
  | "bottom-start"
  | "bottom-end"
  | "left"
  | "left-start"
  | "left-end";

Types - Offset

type offset =
  | number
  | {
      mainAxis?: number;
      crossAxis?: number;
      alignmentAxis?: number | null;
    };

Types - Dismiss

type dismissType = {
  enabled?: boolean;
  escapeKey?: boolean;
  referencePointerDown?: boolean;
  outsidePointerDown?: boolean;
  ancestorScroll?: boolean;
  bubbles?: boolean;
};

Types - Animate

type animate = {
  mount?: object;
  unmount?: object;
};
Edit this page on Github