Chat
Description
A component to display a chat
ChatArea and ChatMessage components allow building modern chat experiences with dynamic, animatable messages using DeltaComponent.
API reference
public class ChatArea : IComponentA chat transcript surface that lays out a sequence of messages with sender attribution, avatars and timestamps.
Methods
public ChatArea OnScroll(ComponentEventHandler<ChatArea, Event> onScroll)Registers a callback invoked when the scroll event fires.
public ChatArea OnFocus(ComponentEventHandler<ChatArea, Event> onFocus)Registers a callback invoked when the focus event fires.
public ChatArea OnBlur(ComponentEventHandler<ChatArea, Event> onBlur)Registers a callback invoked when the blur event fires.
public ChatArea Background(string color)Gets or sets the CSS background of the component.
Events
public event ComponentEventHandler<ChatArea, Event> ScrolledRaised when scrolled occurs.
public event ComponentEventHandler<ChatArea, Event> ReceivedFocusRaised when received focus occurs.
public class ChatMessage : IComponentWithID, IComponentConstructors
Properties
public string Identifier { get; private set; }Gets or sets the identifier.
public string ContentHash { get; private set; }Gets or sets the content hash.
Methods
public ChatMessage LeftAligned()Configures the left aligned on the component.
public ChatMessage RightAligned()Configures the right aligned on the component.
public ChatMessage FullWidth()Stretches the component to the full width of its parent.
public ChatMessage MaxWidth()Gets or sets the CSS max-width of the component.
public ChatMessage Background(string color)Gets or sets the CSS background of the component.
public ChatMessage WithReferences(IEnumerable<IComponent> references)Returns the component configured with the given references.
public ChatMessage WithReferences(IComponent reference)Returns the component configured with the given references.
public ChatMessage ReplaceContent(IComponent newContent)Replaces the content in the component.