Skip to main content

REFERENCE

SDK Demos

How to use @asgard-js/core and @asgard-js/react, with demos you can try on the page.

Render Menu

Use renderMenu to inject a custom menu between the chat body and the input footer. Combined with setInputValue (via ref), you can build hierarchical quick-reply menus that populate the input on click.

  1. Code Example​

    const chatbotRef = useRef<ChatbotRef>(null);

    <Chatbot
    ref={chatbotRef}
    renderMenu={() => (
    <QuickMenu
    onSelect={(question) => chatbotRef.current?.setInputValue?.(question)}
    />
    )}
    {...rest}
    />;
  2. APIDescription
    renderMenu() => ReactNode, rendered between body and footer
    ChatbotRef.setInputValueFill the input programmatically via ref — see ChatbotRef
    ChatbotRef.serviceContextAccess sendMessage to send messages directly

Ready to get started?

Want to see how Asgard fits your team? Talk to us.

Contact us