@dxos/react-ui-menu
    Preparing search index...

    Function createMenuAction

    • Type Parameters

      • P extends {} = {}

      Parameters

      • id: string
      • invoke: (params?: InvokeProps) => void
      • properties: P & MenuItemChrome & {
            checked?: boolean;
            indent?: number;
            render?: (props: CustomRenderProps) => ReactNode;
            value?: string;
            variant?: "action" | "primary" | "toggle" | "switch" | "custom" | "text";
        } & { presentation?: Partial<Record<string, Partial<MenuActionChrome>>> }
        • Optionalchecked?: boolean
        • Optionalindent?: number

          Depth of the row in a menu listing a tree, which indents it beneath its parent row; a toolbar ignores it.

        • Optionalrender?: (props: CustomRenderProps) => ReactNode

          Renders an arbitrary control in place of the standard button. Required when variant is 'custom'; the contributor owns the element (and its interactions) so the toolbar can host affordances the action model cannot express (e.g. press-and-hold, an embedded dropdown).

        • Optionalvalue?: string
        • Optionalvariant?: "action" | "primary" | "toggle" | "switch" | "custom" | "text"

          text is a plain label (a panel's name) that takes the free space; it is not an item and never collapses.

        • Optionalpresentation?: Partial<Record<string, Partial<MenuActionChrome>>>

          Per-surface chrome overrides, keyed by disposition — lets one action declare multiple dispositions (e.g. ['toolbar', 'list-item']) yet render appropriately in each: a primary toolbar button here, a plain context-menu row there. Applied by the surface bridge that already knows which disposition it's rendering (graphActions's surface option, getListActions), so producers declare it once alongside disposition.

      Returns {
          data: (params?: InvokeProps) => Effect<void, never, never>;
          id: string;
          properties: P & MenuItemChrome & {
              checked?: boolean;
              indent?: number;
              render?: (props: CustomRenderProps) => ReactNode;
              value?: string;
              variant?: "action" | "primary" | "toggle" | "switch" | "custom" | "text";
          } & { presentation?: Partial<Record<string, Partial<MenuActionChrome>>> };
          type: string;
      }