UNPKG

@cerberus-design/react

Version:

The Cerberus Design React component library.

35 lines (34 loc) 937 B
import { PropsWithChildren, RefObject } from 'react'; /** * This module provides a context and hook for the nav menu. * @module NavMenu */ export type NavTriggerRef = RefObject<HTMLButtonElement | null>; export type NavMenuRef = RefObject<HTMLUListElement | null>; export interface NavMenuContextValue { /** * The ref for the trigger button. */ triggerRef: NavTriggerRef; /** * The ref for the menu. */ menuRef: NavMenuRef; /** * Whether the menu is expanded. */ expanded: boolean; /** * Called when the menu button is clicked. */ onToggle: () => void; } /** * @deprecated use the {@link Menu} family instead */ export declare function NavMenu(props: PropsWithChildren): import("react/jsx-runtime").JSX.Element; /** * Used to access the nav menu context. * @returns The nav menu context. */ export declare function useNavMenuContext(): NavMenuContextValue;