t×tecexpressby TeKOcloud
DEv0.7.1
Data & views / VUE

TxChat.

Interactive preview

Local message history with authors, typing indicators and send events. sent confirms local acceptance, not server delivery.

PropTypeDefaultMeaning
dataSourceTxSource<ChatMessage> | undefinedundefinedList, configuration or DataSource instance; takes precedence over items.
userChatUserrequiredCurrent chat author.
itemsChatMessage[] | undefinedundefinedEntries; replaced by dataSource when bound.
inputFieldTextstring | undefinedundefinedControlled message draft.
titlestring | undefinedChatView title.
subtitlestring | undefined``Additional subtitle.
labelstring | undefinedChatLabel or accessible name.
placeholderstring | undefinedNachricht schreiben …Hint for an empty input.
emptyTextstring | undefinedNoch keine Nachrichten. Starte die Unterhaltung.Empty state text.
disabledboolean | undefinedfalseDisables interaction.
readOnlyboolean | undefinedfalsePrevents value changes.
loadingboolean | undefinedfalseShows the loading state.
sendingboolean | undefinedfalseDisables sending during an application request.
maxLengthnumber | undefined4000Maximum text length.
typingUsersChatUser[] | undefined[]Authors currently typing.
showAvatarboolean | undefinedtrueShows author avatars.
showUserNameboolean | undefinedtrueShows author names.
showDayHeadersboolean | undefinedtrueGroups messages using day headers.
showMessageTimestampboolean | undefinedtrueShows message timestamps.
localestring | undefinedde-DELocale for date/time formatting.

Events

EventPayload / behavior
update:itemsNew items value; accept using v-model:items (modelValue: v-model).
update:inputFieldTextNew inputFieldText value; accept using v-model:inputFieldText (modelValue: v-model).
messageEnteredChatMessageEnteredEvent; set cancel synchronously to start custom server processing.
messageSentChatMessageEvent after local acceptance.
typingStartChatTypingEvent when typing starts.
typingEndChatTypingEvent when typing ends.

Slots

SlotArguments
header{ user }
empty()
message{ message, isOwn }
vue
<script setup lang="ts">
import { ref } from 'vue'
import { TxChat, type ChatMessage } from '@tekocloud.de/tecexpress'
import '@tekocloud.de/tecexpress/themes/index.css'
const messages = ref<ChatMessage[]>([])
</script>

<template>
  <TxChat v-model:items="messages" :user="{ id: 'me', name: 'Alex' }" />
</template>