Skip to content
THE COMPONENT LIBRARY
Skip to content

Component reference

Chat

Send messages in a local team conversation.

Preview

Live preview

Changes apply to this preview only.

Enter sends · Shift + Enter adds a line.

Design system
#general · 4 members
Online
  1. Lucas Moreau
    I published the semantic aliases for the next preview. The old token names still resolve, so nothing breaks yet.
  2. YouSent
    Perfect. The dark theme resolves the surface and border aliases without a flash on first paint.
  3. Sofia Rossi
    Here is the contrast audit. Two amber badges still fail AA against the glass preset.
  4. Lucas Moreau
    Thanks Sofia. The two amber badges are the only blockers, so I will fix them before the preview build.
  5. YouSending
    I'll take the chart pass this morning and report back with the updated screenshots.
Sofia Rossi and Lucas Moreau are typing…

Width adapts to the available space

More examples

Different configurations and compositions using the real Pimolu API. Each preview runs independently and follows the site appearance.

New conversation

A new conversation composition using Chat.

Open preview

Loading history

A loading history composition using Chat.

Open preview

Read-only conversation

The disabled prop turns the composer off while the archive stays readable. Status labels remain available to assistive technology.

Open preview

Usage

Keep transport, authentication and delivery status in your own messaging service.

API reference

Generated from the public TypeScript declarations. Native HTML attributes are inherited where the component extends them; this reference includes Pimolu props and selected common native attributes.

PimoluChatAuthor

Type source
PimoluChatAuthor public API
NameTypeDefaultDescription
idRequiredstring—Public Pimolu prop; see the source declaration for details.
nameRequiredstring—Public Pimolu prop; see the source declaration for details.
avatarstring | undefined—Public Pimolu prop; see the source declaration for details.
idRequired

string

No default extracted.

Public Pimolu prop; see the source declaration for details.

nameRequired

string

No default extracted.

Public Pimolu prop; see the source declaration for details.

avatar

string | undefined

No default extracted.

Public Pimolu prop; see the source declaration for details.

PimoluChatAttachment

Type source
PimoluChatAttachment public API
NameTypeDefaultDescription
idRequiredstring—Public Pimolu prop; see the source declaration for details.
nameRequiredstring—Public Pimolu prop; see the source declaration for details.
hrefstring | undefined—When provided, the attachment is rendered as a link.
sizenumber | undefined—Size in bytes.
idRequired

string

No default extracted.

Public Pimolu prop; see the source declaration for details.

nameRequired

string

No default extracted.

Public Pimolu prop; see the source declaration for details.

href

string | undefined

No default extracted.

When provided, the attachment is rendered as a link.

size

number | undefined

No default extracted.

Size in bytes.

PimoluChatMessage

Type source
PimoluChatMessage public API
NameTypeDefaultDescription
idRequiredstring—Stable message id.
authorRequiredPimoluChatAuthor—Message author.
bodyRequiredReactNode—Message content. Newlines are preserved.
timeRequiredstring—Display time, for example "09:42".
datestring | undefined—Optional ISO date used to group messages under date separators. Messages without a date never open a separator.
dateLabelstring | undefined—Explicit separator label for this message's date.
ownboolean | undefinedcomparing the author id with `currentUserId`Marks an outgoing message. Defaults to comparing the author id with `currentUserId`.
statusPimoluChatMessageStatus | undefined—Delivery state, shown next to outgoing messages.
attachmentsreadonly PimoluChatAttachment[] | undefined—Attached files.
idRequired

string

No default extracted.

Stable message id.

authorRequired

PimoluChatAuthor

No default extracted.

Message author.

bodyRequired

ReactNode

No default extracted.

Message content. Newlines are preserved.

timeRequired

string

No default extracted.

Display time, for example "09:42".

date

string | undefined

No default extracted.

Optional ISO date used to group messages under date separators. Messages without a date never open a separator.

dateLabel

string | undefined

No default extracted.

Explicit separator label for this message's date.

own

boolean | undefined

Default: comparing the author id with `currentUserId`

Marks an outgoing message. Defaults to comparing the author id with `currentUserId`.

status

PimoluChatMessageStatus | undefined

No default extracted.

Delivery state, shown next to outgoing messages.

attachments

readonly PimoluChatAttachment[] | undefined

No default extracted.

Attached files.

PimoluChatLabels

Type source
PimoluChatLabels public API
NameTypeDefaultDescription
conversationRequiredstring—Accessible name of the conversation region.
messagesRequiredstring—Accessible name of the message log.
messageRequiredstring—Accessible label of the composer.
placeholderRequiredstring—Default composer placeholder.
sendRequiredstring—Accessible name of the send button.
attachRequiredstring—Accessible name of the attachment button.
emptyRequiredstring—Empty-state title.
emptyDescriptionRequiredstring—Empty-state description.
loadingRequiredstringfalseAnnounced while the conversation loads.
typingRequired(names: string) => string—Typing indicator; receives the joined author names.
youRequiredstring—Author label for outgoing messages.
sendingRequiredstring—Accessible status label.
sentRequiredstring—Accessible status label.
failedRequiredstring—Visible status label.
attachmentRequired(name: string) => string—Accessible name of an attachment.
conversationRequired

string

No default extracted.

Accessible name of the conversation region.

messagesRequired

string

No default extracted.

Accessible name of the message log.

messageRequired

string

No default extracted.

Accessible label of the composer.

placeholderRequired

string

No default extracted.

Default composer placeholder.

sendRequired

string

No default extracted.

Accessible name of the send button.

attachRequired

string

No default extracted.

Accessible name of the attachment button.

emptyRequired

string

No default extracted.

Empty-state title.

emptyDescriptionRequired

string

No default extracted.

Empty-state description.

loadingRequired

string

Default: false

Announced while the conversation loads.

typingRequired

(names: string) => string

No default extracted.

Typing indicator; receives the joined author names.

youRequired

string

No default extracted.

Author label for outgoing messages.

sendingRequired

string

No default extracted.

Accessible status label.

sentRequired

string

No default extracted.

Accessible status label.

failedRequired

string

No default extracted.

Visible status label.

attachmentRequired

(name: string) => string

No default extracted.

Accessible name of an attachment.

PimoluChatProps

Type source
PimoluChatProps public API
NameTypeDefaultDescription
messagesRequiredreadonly PimoluChatMessage[]—Conversation messages, oldest first. Never mutated.
currentUserIdRequiredstring—Id used to identify outgoing messages.
onSendRequired(body: string) => void—Called with the trimmed composer value.
placeholderstring | undefined—Overrides the default composer placeholder.
disabledboolean | undefinedfalseDisables the whole composer.
loadingboolean | undefinedfalseReplaces the message area with a loading state.
headerReactNode—Custom header content, for example a channel name and presence.
emptyStateReactNode—Replaces the default empty state.
typingUsersreadonly string[] | undefined[]Names shown in the typing indicator. Empty hides it.
onAttach(() => void) | undefined—Shows an attachment button when provided.
sendOnEnterboolean | undefinedtrueWhen true (default), Enter sends and Shift + Enter inserts a newline. When false, only the send button submits.
maxLengthnumber | undefined—Native textarea maxlength.
labelsPartial<PimoluChatLabels> | undefined—Overrides the built-in accessible labels.
onChangeChangeEventHandler<HTMLDivElement, Element> | undefined—Standard React/HTML attribute.
defaultValuestring | number | readonly string[] | undefined—Standard React/HTML attribute.
classNamestring | undefined—Standard React/HTML attribute.
styleCSSProperties | undefined—Standard React/HTML attribute.
aria-labelstring | undefined—Defines a string value that labels the current element.
onClickMouseEventHandler<HTMLDivElement> | undefined—Standard React/HTML attribute.
messagesRequired

readonly PimoluChatMessage[]

No default extracted.

Conversation messages, oldest first. Never mutated.

currentUserIdRequired

string

No default extracted.

Id used to identify outgoing messages.

onSendRequired

(body: string) => void

No default extracted.

Called with the trimmed composer value.

placeholder

string | undefined

No default extracted.

Overrides the default composer placeholder.

disabled

boolean | undefined

Default: false

Disables the whole composer.

loading

boolean | undefined

Default: false

Replaces the message area with a loading state.

header

ReactNode

No default extracted.

Custom header content, for example a channel name and presence.

emptyState

ReactNode

No default extracted.

Replaces the default empty state.

typingUsers

readonly string[] | undefined

Default: []

Names shown in the typing indicator. Empty hides it.

onAttach

(() => void) | undefined

No default extracted.

Shows an attachment button when provided.

sendOnEnter

boolean | undefined

Default: true

When true (default), Enter sends and Shift + Enter inserts a newline. When false, only the send button submits.

maxLength

number | undefined

No default extracted.

Native textarea maxlength.

labels

Partial<PimoluChatLabels> | undefined

No default extracted.

Overrides the built-in accessible labels.

onChange

ChangeEventHandler<HTMLDivElement, Element> | undefined

No default extracted.

Standard React/HTML attribute.

defaultValue

string | number | readonly string[] | undefined

No default extracted.

Standard React/HTML attribute.

className

string | undefined

No default extracted.

Standard React/HTML attribute.

style

CSSProperties | undefined

No default extracted.

Standard React/HTML attribute.

aria-label

string | undefined

No default extracted.

Defines a string value that labels the current element.

onClick

MouseEventHandler<HTMLDivElement> | undefined

No default extracted.

Standard React/HTML attribute.

Accessibility

  • Label the composer and announce new messages without repeatedly reading the whole history.
Read the accessibility guide →