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.
- Namespace
- Tesserae
- Implements
- IComponent
Constructors
| Name | Description |
|---|---|
| ChatArea | Initializes a new instance of this class. |
Methods
| Name | Description |
|---|---|
| OnScroll | Registers a callback invoked when the scroll event fires. |
| OnFocus | Registers a callback invoked when the focus event fires. |
| OnBlur | Registers a callback invoked when the blur event fires. |
| Background | Gets or sets the CSS background of the component. |
| Add | Adds the given item to the component. |
| Clear | Clears the component's current state. |
| Render | Renders the component's root HTML element. |
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
| Name | Description |
|---|---|
| Scrolled | Raised when scrolled occurs. |
| ReceivedFocus | Raised when received focus occurs. |
| LostFocus | Raised when lost focus occurs. |
public event ComponentEventHandler<ChatArea, Event> ScrolledRaised when scrolled occurs.
public event ComponentEventHandler<ChatArea, Event> ReceivedFocusRaised when received focus occurs.
public class ChatMessage : IComponentWithID, IComponent- Namespace
- Tesserae
- Implements
- IComponentWithID, IComponent
Constructors
| Name | Description |
|---|---|
| ChatMessage | Initializes a new instance of this class. |
Properties
| Name | Description |
|---|---|
| Identifier | Gets or sets the identifier. |
| ContentHash | Gets or sets the content hash. |
| BubbleBackground | Gets or sets the bubble background. |
public string Identifier { get; private set; }Gets or sets the identifier.
public string ContentHash { get; private set; }Gets or sets the content hash.
Methods
| Name | Description |
|---|---|
| LeftAligned | Configures the left aligned on the component. |
| RightAligned | Configures the right aligned on the component. |
| FullWidth | Stretches the component to the full width of its parent. |
| MaxWidth | Gets or sets the CSS max-width of the component. |
| Background | Gets or sets the CSS background of the component. |
| WithReferences | Returns the component configured with the given references. |
| ReplaceContent | Replaces the content in the component. |
| KeepVisible | Configures the keep visible on the component. |
| Render | Renders the component's root HTML element. |
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.
| Overload | |
|---|---|
| WithReferences(IEnumerable<IComponent>) | Returns the component configured with the given references. |
| WithReferences(IComponent) | Returns the component configured with the given references. |
public ChatMessage ReplaceContent(IComponent newContent)Replaces the content in the component.