Options
All
  • Public
  • Public/Protected
  • All
Menu

react-accessible-menu

Index

Type aliases

ItemId

ItemId: string | number

Functions

Const Menu

  • Menu<T>(props: MenuProps<T, any> & { ref?: ForwardedRef<MenuImperativeHandle<any>> }): null | ReactElement<any, string | JSXElementConstructor<any>>
  • Type parameters

    • T: HTMLElement = HTMLDivElement

    Parameters

    Returns null | ReactElement<any, string | JSXElementConstructor<any>>

MenuItem

  • MenuItem<E, D>(__namedParameters: MenuItemProps<E, D>): null | ReactElement<any, string | JSXElementConstructor<any>>
  • Type parameters

    • E: HTMLElement = HTMLDivElement

    • D = any

    Parameters

    Returns null | ReactElement<any, string | JSXElementConstructor<any>>

Const useMenu

  • useMenu<E, D>(__namedParameters: UseMenuProps<E, D>): { Provider: Provider<MenuContextProps>; contextProps: MenuContextProps; focusItem: (itemId: ItemId, passive?: any) => void; focusedItem: null | ItemId; getItem: (id: ItemId) => undefined | RegisteredItem; items: MutableRefObject<RegisteredItem[]>; moveFocusIndexRelative: (direction: "up" | "down") => void; moveFocusToCharacter: (character: string) => void; moveFocusToEnd: () => void; moveFocusToStart: () => void; renderProps: MenuRenderProps<E, D>; reorder: () => void }
  • Type parameters

    • E: HTMLElement = HTMLDivElement

    • D = any

    Parameters

    Returns { Provider: Provider<MenuContextProps>; contextProps: MenuContextProps; focusItem: (itemId: ItemId, passive?: any) => void; focusedItem: null | ItemId; getItem: (id: ItemId) => undefined | RegisteredItem; items: MutableRefObject<RegisteredItem[]>; moveFocusIndexRelative: (direction: "up" | "down") => void; moveFocusToCharacter: (character: string) => void; moveFocusToEnd: () => void; moveFocusToStart: () => void; renderProps: MenuRenderProps<E, D>; reorder: () => void }

    • Provider: Provider<MenuContextProps>
    • contextProps: MenuContextProps
    • focusItem: (itemId: ItemId, passive?: any) => void
        • (itemId: ItemId, passive?: any): void
        • Parameters

          • itemId: ItemId
          • passive: any = false

          Returns void

    • focusedItem: null | ItemId
    • getItem: (id: ItemId) => undefined | RegisteredItem
    • items: MutableRefObject<RegisteredItem[]>
    • moveFocusIndexRelative: (direction: "up" | "down") => void
        • (direction: "up" | "down"): void
        • Parameters

          • direction: "up" | "down"

          Returns void

    • moveFocusToCharacter: (character: string) => void
        • (character: string): void
        • Parameters

          • character: string

          Returns void

    • moveFocusToEnd: () => void
        • (): void
        • Returns void

    • moveFocusToStart: () => void
        • (): void
        • Returns void

    • renderProps: MenuRenderProps<E, D>
    • reorder: () => void
        • (): void
        • Returns void

Const useMenuContext

Const useMenuItem

Generated using TypeDoc