Skip to content

Latest commit

 

History

History
51 lines (45 loc) · 1.74 KB

STARTUP.md

File metadata and controls

51 lines (45 loc) · 1.74 KB

How to install and start using Mynah UI

Simply install it from npm with your favorite package manager.

npm install @aws/mynah-ui

When you import @aws/mynah-ui it provides you the main MynahUI class to generate a new all-in-one object to create and render the UI inside a desired DOM element. While creating the UI, you can provide the initial and default datas to be shown. You can also connect to the user interaction events through the initial properties. Additionally you can also configure the texts depending on your language preferences.

import { MynahUI } from '@aws/mynah-ui';

// Assign it to a variable to be able call functions.
const mynahUI = new MynahUI({
    // All props are optional
    // so even without providing anything
    // it will create the UI
    rootSelector: ...,
    defaults: ...,
    tabs: ...,
    config: ...,
    onShowMoreWebResultsClick: ...,
    onReady: ...,
    onVote: ...,
    onStopChatResponse: ...,
    onResetStore: ...,
    onChatPrompt: ...,
    onFollowUpClicked: ...,
    onBodyActionClicked: ...,
    onTabChange: ...,
    onTabAdd: ...,
    onTabRemove: ...,
    onChatItemEngagement: ...,
    onCopyCodeToClipboard: ...,
    onCodeInsertToCursorPosition: ...,
    onSourceLinkClick: ...,
    onLinkClick: ...,
    onInfoLinkClick: ...,
    onSendFeedback: ...,
    onOpenDiff: ...,
});

You're ready to go, now you have a Chat UI generated and rendered into place you set.

What's Next?