IgrChatOptions

Configuration options for customizing the behavior and appearance of the chat component.

Optional acceptedFiles

Section titled "acceptedFiles"

The accepted files that could be attached. Defines the file types as a list of comma-separated values (e.g. "image/*,.pdf") that the file input should accept.

acceptedFiles?: string

Optional adoptRootStyles

Section titled "adoptRootStyles"

A boolean flag that, when true, enables a quick and dirty workaround for styling components rendered within the Shadow DOM, from custom message renderers, by allowing them to inherit styles from the document's root. This can be useful for developers who prefer not to handle Shadow DOM encapsulation, but it is not the recommended approach.

It is highly advised to use standard Web Component styling methods first, in this order:

  1. CSS Variables and Parts API: Use the exposed ::part API with custom CSS variables to style your content in your custom renderers.

  2. link elements: For larger style sheets, link them directly within the Shadow DOM to maintain encapsulation.

  3. Inline <style> tags: Use these for small, self-contained styles within a template.

This property should be used as a last resort as it can lead to style leakage, where global styles unexpectedly bleed into the component, breaking encapsulation and causing unpredictable visual issues.

adoptRootStyles?: boolean

Optional currentUserId

Section titled "currentUserId"

The ID of the current user. Used to differentiate between incoming and outgoing messages.

currentUserId?: string

Optional disableAutoScroll

Section titled "disableAutoScroll"

If true, prevents the chat from automatically scrolling to the latest message.

disableAutoScroll?: boolean

Optional disableInputAttachments

Section titled "disableInputAttachments"

If true, disables the ability to upload and send attachments. Defaults to false.

disableInputAttachments?: boolean

Optional headerText

Section titled "headerText"

Optional header text to display at the top of the chat component.

headerText?: string

Optional inputPlaceholder

Section titled "inputPlaceholder"

Optional placeholder text for the chat input area. Provides a hint to the user about what they can type (e.g. "Type a message...").

inputPlaceholder?: string

Optional isTyping

Section titled "isTyping"

Indicates whether the other user is currently typing a message.

isTyping?: boolean

Optional renderers

Section titled "renderers"

An object containing a collection of custom renderers for different parts of the chat UI.

renderers?: ChatRenderers

Optional stopTypingDelay

Section titled "stopTypingDelay"

Time in milliseconds to wait before dispatching a stop typing event. Default is 3000.

stopTypingDelay?: number

Optional suggestions

Section titled "suggestions"

Suggested text snippets or quick replies that can be shown as user-selectable options.

suggestions?: string[]

Optional suggestionsPosition

Section titled "suggestionsPosition"

Controls the position of the chat suggestions within the component layout.

  • "below-input": Renders suggestions below the chat input area.
  • "below-messages": Renders suggestions below the chat messages area.

Default is "below-messages".

suggestionsPosition?: ChatSuggestionsPosition